Class: Nanoc::Int::ProcessingActions::Snapshot

Inherits:
Nanoc::Int::ProcessingAction show all
Defined in:
lib/nanoc/base/entities/processing_actions/snapshot.rb

Constant Summary

NONE =
Object.new

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Nanoc::Int::ProcessingAction

#inspect

Constructor Details

#initialize(snapshot_name, path) ⇒ Snapshot

Returns a new instance of Snapshot



9
10
11
12
# File 'lib/nanoc/base/entities/processing_actions/snapshot.rb', line 9

def initialize(snapshot_name, path)
  @snapshot_name = snapshot_name
  @path = path
end

Instance Attribute Details

#pathObject (readonly)

Returns the value of attribute path



7
8
9
# File 'lib/nanoc/base/entities/processing_actions/snapshot.rb', line 7

def path
  @path
end

#snapshot_nameObject (readonly)

snapshot :before_layout snapshot :before_layout, path: ‘/about.md’



6
7
8
# File 'lib/nanoc/base/entities/processing_actions/snapshot.rb', line 6

def snapshot_name
  @snapshot_name
end

Instance Method Details

#copy(path: NONE) ⇒ Object



20
21
22
# File 'lib/nanoc/base/entities/processing_actions/snapshot.rb', line 20

def copy(path: NONE)
  self.class.new(@snapshot_name, path.equal?(NONE) ? @path : path)
end

#serializeObject



14
15
16
# File 'lib/nanoc/base/entities/processing_actions/snapshot.rb', line 14

def serialize
  [:snapshot, @snapshot_name, true, @path]
end

#to_sObject



24
25
26
# File 'lib/nanoc/base/entities/processing_actions/snapshot.rb', line 24

def to_s
  "snapshot #{@snapshot_name.inspect}, path: #{@path.inspect}"
end