Class: PagerTree::Integrations::AdditionalDatum

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

Instance Method Summary collapse

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

#formatObject

Returns the value of attribute format.



9
10
11
# File 'app/models/pager_tree/integrations/additional_datum.rb', line 9

def format
  @format
end

#labelObject

Returns the value of attribute label.



10
11
12
# File 'app/models/pager_tree/integrations/additional_datum.rb', line 10

def label
  @label
end

#valueObject

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_hObject



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