Class: Nanoc::Core::ProcessingActions::Filter
- Inherits:
-
Nanoc::Core::ProcessingAction
- Object
- Nanoc::Core::ProcessingAction
- Nanoc::Core::ProcessingActions::Filter
- Defined in:
- lib/nanoc/core/processing_actions/filter.rb
Instance Attribute Summary collapse
-
#filter_name ⇒ Object
readonly
filter :foo filter :foo, params.
-
#params ⇒ Object
readonly
Returns the value of attribute params.
Instance Method Summary collapse
- #==(other) ⇒ Object
- #eql?(other) ⇒ Boolean
- #hash ⇒ Object
-
#initialize(filter_name, params) ⇒ Filter
constructor
A new instance of Filter.
- #serialize ⇒ Object
- #to_s ⇒ Object
Methods inherited from Nanoc::Core::ProcessingAction
Constructor Details
#initialize(filter_name, params) ⇒ Filter
Returns a new instance of Filter.
15 16 17 18 |
# File 'lib/nanoc/core/processing_actions/filter.rb', line 15 def initialize(filter_name, params) @filter_name = filter_name @params = params end |
Instance Attribute Details
#filter_name ⇒ Object (readonly)
filter :foo filter :foo, params
12 13 14 |
# File 'lib/nanoc/core/processing_actions/filter.rb', line 12 def filter_name @filter_name end |
#params ⇒ Object (readonly)
Returns the value of attribute params.
13 14 15 |
# File 'lib/nanoc/core/processing_actions/filter.rb', line 13 def params @params end |
Instance Method Details
#==(other) ⇒ Object
32 33 34 |
# File 'lib/nanoc/core/processing_actions/filter.rb', line 32 def ==(other) self.class == other.class && filter_name == other.filter_name && params == other.params end |
#eql?(other) ⇒ Boolean
36 37 38 |
# File 'lib/nanoc/core/processing_actions/filter.rb', line 36 def eql?(other) self == other end |
#hash ⇒ Object
28 29 30 |
# File 'lib/nanoc/core/processing_actions/filter.rb', line 28 def hash self.class.hash ^ filter_name.hash ^ params.hash end |
#serialize ⇒ Object
20 21 22 |
# File 'lib/nanoc/core/processing_actions/filter.rb', line 20 def serialize [:filter, @filter_name, Nanoc::Core::Checksummer.calc(@params)] end |
#to_s ⇒ Object
24 25 26 |
# File 'lib/nanoc/core/processing_actions/filter.rb', line 24 def to_s "filter #{@filter_name.inspect}, #{@params.inspect}" end |