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

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Nanoc::Int::ProcessingAction

#inspect

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

#pathsObject (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_namesObject (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

#serializeObject



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

def serialize
  [:snapshot, @snapshot_names, true, @paths]
end

#to_sObject



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