Class: Hydra::Derivatives::TransformationDirective
- Inherits:
-
Object
- Object
- Hydra::Derivatives::TransformationDirective
- Defined in:
- lib/hydra/derivatives.rb
Instance Attribute Summary collapse
-
#derivatives ⇒ Object
Returns the value of attribute derivatives.
-
#differentiator ⇒ Object
Returns the value of attribute differentiator.
-
#processors ⇒ Object
Returns the value of attribute processors.
-
#selector ⇒ Object
Returns the value of attribute selector.
Instance Method Summary collapse
- #applies?(object) ⇒ Boolean
-
#initialize(args) ⇒ TransformationDirective
constructor
A new instance of TransformationDirective.
Constructor Details
#initialize(args) ⇒ TransformationDirective
Returns a new instance of TransformationDirective.
82 83 84 85 86 87 |
# File 'lib/hydra/derivatives.rb', line 82 def initialize(args) self.differentiator = args[:when] self.selector = args[:is_one_of] || args[:is] self.derivatives = args[:derivatives] self.processors = args[:processors] end |
Instance Attribute Details
#derivatives ⇒ Object
Returns the value of attribute derivatives.
75 76 77 |
# File 'lib/hydra/derivatives.rb', line 75 def derivatives @derivatives end |
#differentiator ⇒ Object
Returns the value of attribute differentiator.
75 76 77 |
# File 'lib/hydra/derivatives.rb', line 75 def differentiator @differentiator end |
#processors ⇒ Object
Returns the value of attribute processors.
75 76 77 |
# File 'lib/hydra/derivatives.rb', line 75 def processors @processors end |
#selector ⇒ Object
Returns the value of attribute selector.
75 76 77 |
# File 'lib/hydra/derivatives.rb', line 75 def selector @selector end |
Instance Method Details
#applies?(object) ⇒ Boolean
89 90 91 |
# File 'lib/hydra/derivatives.rb', line 89 def applies?(object) selector.include?(object.send(differentiator)) end |