Class: PagerTree::Integrations::AdditionalDatum
- Inherits:
-
Object
- Object
- PagerTree::Integrations::AdditionalDatum
- Extended by:
- ActiveModel::Callbacks
- Includes:
- ActiveModel::API, ActiveModel::Model
- Defined in:
- app/models/pager_tree/integrations/additional_datum.rb
Constant Summary collapse
- FORMATS =
["text", "link", "img", "email", "phone", "datetime"]
Instance Attribute Summary collapse
-
#format ⇒ Object
Returns the value of attribute format.
-
#label ⇒ Object
Returns the value of attribute label.
-
#value ⇒ Object
Returns the value of attribute value.
Instance Method Summary collapse
-
#initialize(params = {}) ⇒ AdditionalDatum
constructor
A new instance of AdditionalDatum.
- #to_h ⇒ Object
Constructor Details
#initialize(params = {}) ⇒ AdditionalDatum
Returns a new instance of AdditionalDatum.
21 22 23 24 25 |
# File 'app/models/pager_tree/integrations/additional_datum.rb', line 21 def initialize(params = {}) run_callbacks :initialize do super(params) end end |
Instance Attribute Details
#format ⇒ Object
Returns the value of attribute format.
9 10 11 |
# File 'app/models/pager_tree/integrations/additional_datum.rb', line 9 def format @format end |
#label ⇒ Object
Returns the value of attribute label.
10 11 12 |
# File 'app/models/pager_tree/integrations/additional_datum.rb', line 10 def label @label end |
#value ⇒ Object
Returns the value of attribute value.
11 12 13 |
# File 'app/models/pager_tree/integrations/additional_datum.rb', line 11 def value @value end |
Instance Method Details
#to_h ⇒ Object
33 34 35 36 37 38 39 |
# File 'app/models/pager_tree/integrations/additional_datum.rb', line 33 def to_h { format: self.format, label: self.label, value: self.value } end |