Class: PushType::Structure

Inherits:
Object show all
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

Instance Method Summary collapse

Methods included from Presentable

#present!, #presenter_class

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_storeObject

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

Returns:

  • (Boolean)


23
24
25
# File 'app/models/push_type/structure.rb', line 23

def blank?
  fields.map { |k, f| f.value }.all?(&:blank?)
end