Class: Nanoc::Int::ProcessingActions::Snapshot
- Inherits:
-
Nanoc::Int::ProcessingAction
- Object
- Nanoc::Int::ProcessingAction
- Nanoc::Int::ProcessingActions::Snapshot
- Defined in:
- lib/nanoc/base/entities/processing_actions/snapshot.rb
Instance Attribute Summary collapse
-
#paths ⇒ Object
readonly
Returns the value of attribute paths.
-
#snapshot_names ⇒ Object
readonly
Returns the value of attribute snapshot_names.
Instance Method Summary collapse
-
#initialize(snapshot_names, paths) ⇒ Snapshot
constructor
A new instance of Snapshot.
-
#serialize ⇒ Object
-
#to_s ⇒ Object
-
#update(snapshot_names: [], paths: []) ⇒ Object
Methods inherited from Nanoc::Int::ProcessingAction
Constructor Details
#initialize(snapshot_names, paths) ⇒ Snapshot
Returns a new instance of Snapshot
14 15 16 17 |
# File 'lib/nanoc/base/entities/processing_actions/snapshot.rb', line 14 def initialize(snapshot_names, paths) @snapshot_names = snapshot_names @paths = paths end |
Instance Attribute Details
#paths ⇒ Object (readonly)
Returns the value of attribute paths
11 12 13 |
# File 'lib/nanoc/base/entities/processing_actions/snapshot.rb', line 11 def paths @paths end |
#snapshot_names ⇒ Object (readonly)
Returns the value of attribute snapshot_names
10 11 12 |
# File 'lib/nanoc/base/entities/processing_actions/snapshot.rb', line 10 def snapshot_names @snapshot_names end |
Instance Method Details
#serialize ⇒ Object
20 21 22 |
# File 'lib/nanoc/base/entities/processing_actions/snapshot.rb', line 20 def serialize [:snapshot, @snapshot_names, true, @paths] end |
#to_s ⇒ Object
30 31 32 |
# File 'lib/nanoc/base/entities/processing_actions/snapshot.rb', line 30 def to_s "snapshot #{@snapshot_names.inspect}, paths: #{@paths.inspect}" end |
#update(snapshot_names: [], paths: []) ⇒ Object
25 26 27 |
# File 'lib/nanoc/base/entities/processing_actions/snapshot.rb', line 25 def update(snapshot_names: [], paths: []) self.class.new(@snapshot_names + snapshot_names, @paths + paths) end |