Class: Serega::AttributeValueResolvers::HashAccessDelegate
- Inherits:
-
Object
- Object
- Serega::AttributeValueResolvers::HashAccessDelegate
- Defined in:
- lib/serega/attribute_value_resolvers/hash_access.rb
Overview
Value resolver for attributes with :hash_access and :delegate (without :allow_nil) options
Instance Method Summary collapse
-
#call(object) ⇒ Object
Delegates the value reading through the intermediate object.
-
#initialize(to_step, final_step) ⇒ HashAccessDelegate
constructor
A new instance of HashAccessDelegate.
Constructor Details
#initialize(to_step, final_step) ⇒ HashAccessDelegate
Returns a new instance of HashAccessDelegate.
81 82 83 84 |
# File 'lib/serega/attribute_value_resolvers/hash_access.rb', line 81 def initialize(to_step, final_step) @to_step = to_step @final_step = final_step end |
Instance Method Details
#call(object) ⇒ Object
Delegates the value reading through the intermediate object
92 93 94 |
# File 'lib/serega/attribute_value_resolvers/hash_access.rb', line 92 def call(object) @final_step.call(@to_step.call(object)) end |