Class: Amorail::Property::Lead

Inherits:
PropertyItem show all
Defined in:
lib/amorail/property.rb

Instance Attribute Summary collapse

Attributes inherited from PropertyItem

#data

Class Method Summary collapse

Methods inherited from PropertyItem

#[], #initialize

Methods included from MethodMissing

#method_missing, #respond_to_missing?

Constructor Details

This class inherits a constructor from Amorail::Property::PropertyItem

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Amorail::MethodMissing

Instance Attribute Details

#statusesObject

Returns the value of attribute statuses.



102
103
104
# File 'lib/amorail/property.rb', line 102

def statuses
  @statuses
end

Class Method Details

.parse(data) ⇒ Object



105
106
107
108
109
110
111
112
113
# File 'lib/amorail/property.rb', line 105

def parse(data)
  obj = super
  hash = {}
  data.fetch('leads_statuses', []).each do |prop|
    hash[prop['name']] = PropertyItem.new(prop)
  end
  obj.statuses = hash
  obj
end