Class: Nanoc::Core::ProcessingActions::Layout

Inherits:
Nanoc::Core::ProcessingAction show all
Defined in:
lib/nanoc/core/processing_actions/layout.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Nanoc::Core::ProcessingAction

#inspect

Constructor Details

#initialize(layout_identifier, params) ⇒ Layout

Returns a new instance of Layout.



13
14
15
16
# File 'lib/nanoc/core/processing_actions/layout.rb', line 13

def initialize(layout_identifier, params)
  @layout_identifier = layout_identifier
  @params = params
end

Instance Attribute Details

#layout_identifierObject (readonly)

layout ‘/foo.erb’ layout ‘/foo.erb’, params



10
11
12
# File 'lib/nanoc/core/processing_actions/layout.rb', line 10

def layout_identifier
  @layout_identifier
end

#paramsObject (readonly)

Returns the value of attribute params.



11
12
13
# File 'lib/nanoc/core/processing_actions/layout.rb', line 11

def params
  @params
end

Instance Method Details

#==(other) ⇒ Object



30
31
32
# File 'lib/nanoc/core/processing_actions/layout.rb', line 30

def ==(other)
  self.class == other.class && layout_identifier == other.layout_identifier && params == other.params
end

#eql?(other) ⇒ Boolean

Returns:

  • (Boolean)


34
35
36
# File 'lib/nanoc/core/processing_actions/layout.rb', line 34

def eql?(other)
  self == other
end

#hashObject



26
27
28
# File 'lib/nanoc/core/processing_actions/layout.rb', line 26

def hash
  self.class.hash ^ layout_identifier.hash ^ params.hash
end

#serializeObject



18
19
20
# File 'lib/nanoc/core/processing_actions/layout.rb', line 18

def serialize
  [:layout, @layout_identifier, Nanoc::Core::Checksummer.calc(@params)]
end

#to_sObject



22
23
24
# File 'lib/nanoc/core/processing_actions/layout.rb', line 22

def to_s
  "layout #{@layout_identifier.inspect}, #{@params.inspect}"
end