Class: Nanoc::Int::RuleMemoryActions::Snapshot

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Nanoc::Int::RuleMemoryAction

#inspect

Constructor Details

#initialize(snapshot_name, final, path) ⇒ Snapshot

Returns a new instance of Snapshot



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

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

Instance Attribute Details

#finalObject (readonly) Also known as: final?

Returns the value of attribute final



8
9
10
# File 'lib/nanoc/base/entities/rule_memory_actions/snapshot.rb', line 8

def final
  @final
end

#pathObject (readonly)

Returns the value of attribute path



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

def path
  @path
end

#snapshot_nameObject (readonly)

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



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

def snapshot_name
  @snapshot_name
end

Instance Method Details

#serializeObject



18
19
20
# File 'lib/nanoc/base/entities/rule_memory_actions/snapshot.rb', line 18

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

#to_sObject



22
23
24
# File 'lib/nanoc/base/entities/rule_memory_actions/snapshot.rb', line 22

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