Module: Gossiper::Concerns::Models::DynamicAttributes
- Extended by:
- ActiveSupport::Concern
- Included in:
- Notification
- Defined in:
- lib/gossiper/concerns/models/dynamic_attributes.rb
Defined Under Namespace
Modules: ClassMethods
Instance Method Summary collapse
- #dynamic_attribute_get(name) ⇒ Object
- #dynamic_attribute_set(name, value) ⇒ Object
- #dynamic_attributes ⇒ Object
Instance Method Details
#dynamic_attribute_get(name) ⇒ Object
32 33 34 |
# File 'lib/gossiper/concerns/models/dynamic_attributes.rb', line 32 def dynamic_attribute_get(name) self.dynamic_attributes[name.to_s] end |
#dynamic_attribute_set(name, value) ⇒ Object
28 29 30 |
# File 'lib/gossiper/concerns/models/dynamic_attributes.rb', line 28 def dynamic_attribute_set(name, value) self.dynamic_attributes = dynamic_attributes.merge({ name.to_s => value }) end |
#dynamic_attributes ⇒ Object
36 37 38 |
# File 'lib/gossiper/concerns/models/dynamic_attributes.rb', line 36 def dynamic_attributes read_attribute(:dynamic_attributes).presence || {} end |