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
17
18
# File 'lib/nanoc/core/processing_actions/layout.rb', line 13

def initialize(layout_identifier, params)
  super()

  @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



32
33
34
# File 'lib/nanoc/core/processing_actions/layout.rb', line 32

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

#eql?(other) ⇒ Boolean

Returns:

  • (Boolean)


36
37
38
# File 'lib/nanoc/core/processing_actions/layout.rb', line 36

def eql?(other)
  self == other
end

#hashObject



28
29
30
# File 'lib/nanoc/core/processing_actions/layout.rb', line 28

def hash
  [self.class, layout_identifier, params].hash
end

#serializeObject



20
21
22
# File 'lib/nanoc/core/processing_actions/layout.rb', line 20

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

#to_sObject



24
25
26
# File 'lib/nanoc/core/processing_actions/layout.rb', line 24

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