Module: AttributesHelper
- Defined in:
- app/helpers/attributes_helper.rb
Instance Method Summary collapse
- #current_attributes_object ⇒ Object
- #current_attributes_strategy ⇒ Object
- #with_attribute_settings(object: current_attributes_object, strategy: current_attributes_strategy) ⇒ Object
Instance Method Details
#current_attributes_object ⇒ Object
2 3 4 |
# File 'app/helpers/attributes_helper.rb', line 2 def current_attributes_object @_current_attribute_settings&.dig(:object) end |
#current_attributes_strategy ⇒ Object
6 7 8 |
# File 'app/helpers/attributes_helper.rb', line 6 def current_attributes_strategy @_current_attribute_settings&.dig(:strategy) end |
#with_attribute_settings(object: current_attributes_object, strategy: current_attributes_strategy) ⇒ Object
10 11 12 13 14 15 16 |
# File 'app/helpers/attributes_helper.rb', line 10 def with_attribute_settings(object: current_attributes_object, strategy: current_attributes_strategy) old_attribute_settings = @_current_attribute_settings @_current_attribute_settings = {object: object, strategy: strategy} yield ensure @_current_attribute_settings = old_attribute_settings end |