Class: PushType::Structure
- Extended by:
- ActiveModel::Callbacks
- Includes:
- ActiveModel::Model, ActiveRecord::AttributeAssignment, ActiveRecord::Store, Customizable, Presentable
- Defined in:
- app/models/push_type/structure.rb
Instance Attribute Summary collapse
-
#field_store ⇒ Object
Returns the value of attribute field_store.
Instance Method Summary collapse
- #blank? ⇒ Boolean
-
#initialize(*args) ⇒ Structure
constructor
A new instance of Structure.
Methods included from Presentable
Methods included from Customizable
#attribute_for_inspect, #fields
Constructor Details
#initialize(*args) ⇒ Structure
Returns a new instance of Structure.
16 17 18 19 20 21 |
# File 'app/models/push_type/structure.rb', line 16 def initialize(*args) run_callbacks :initialize do @field_store ||= {} super end end |
Instance Attribute Details
#field_store ⇒ Object
Returns the value of attribute field_store.
4 5 6 |
# File 'app/models/push_type/structure.rb', line 4 def field_store @field_store end |
Instance Method Details
#blank? ⇒ Boolean
23 24 25 |
# File 'app/models/push_type/structure.rb', line 23 def blank? fields.map { |k, f| f.value }.all?(&:blank?) end |