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.
13 14 15 16 |
# File 'lib/nanoc/core/processing_actions/filter.rb', line 13 def initialize(filter_name, params) @filter_name = filter_name @params = params end |
Instance Attribute Details
#filter_name ⇒ Object (readonly)
filter :foo filter :foo, params
10 11 12 |
# File 'lib/nanoc/core/processing_actions/filter.rb', line 10 def filter_name @filter_name end |
#params ⇒ Object (readonly)
Returns the value of attribute params.
11 12 13 |
# File 'lib/nanoc/core/processing_actions/filter.rb', line 11 def params @params end |
Instance Method Details
#==(other) ⇒ Object
30 31 32 |
# File 'lib/nanoc/core/processing_actions/filter.rb', line 30 def ==(other) self.class == other.class && filter_name == other.filter_name && params == other.params end |
#eql?(other) ⇒ Boolean
34 35 36 |
# File 'lib/nanoc/core/processing_actions/filter.rb', line 34 def eql?(other) self == other end |
#hash ⇒ Object
26 27 28 |
# File 'lib/nanoc/core/processing_actions/filter.rb', line 26 def hash self.class.hash ^ filter_name.hash ^ params.hash end |
#serialize ⇒ Object
18 19 20 |
# File 'lib/nanoc/core/processing_actions/filter.rb', line 18 def serialize [:filter, @filter_name, Nanoc::Core::Checksummer.calc(@params)] end |
#to_s ⇒ Object
22 23 24 |
# File 'lib/nanoc/core/processing_actions/filter.rb', line 22 def to_s "filter #{@filter_name.inspect}, #{@params.inspect}" end |