Class: PipedriveJetrockets::Deal
- Defined in:
- lib/pipedrive_jetrockets/deal.rb
Instance Attribute Summary collapse
-
#organization ⇒ Object
Returns the value of attribute organization.
-
#person ⇒ Object
Returns the value of attribute person.
Instance Method Summary collapse
- #display_stage_name ⇒ Object
-
#initialize(hash) ⇒ Deal
constructor
A new instance of Deal.
- #stage ⇒ Object
Methods inherited from Entity
#assign_custom_fields, #transform_field_name
Constructor Details
#initialize(hash) ⇒ Deal
Returns a new instance of Deal.
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/pipedrive_jetrockets/deal.rb', line 7 def initialize(hash) @@key_name_hash ||= Pipedrive.deal_fields.key_field_hash super(hash.except(*@@key_name_hash.keys)) org_id = hash['org_id'] person_id = hash['person_id'] assign_custom_fields(@@key_name_hash, hash) if org_id if org_id.kind_of? Integer @organization = Pipedrive.organizations.find(org_id) else @organization = Organization.new(org_id) end end if person_id if person_id.kind_of? Integer @person = Pipedrive.persons.find(person_id) else @person = Person.new(person_id) end end end |
Instance Attribute Details
#organization ⇒ Object
Returns the value of attribute organization.
6 7 8 |
# File 'lib/pipedrive_jetrockets/deal.rb', line 6 def organization @organization end |
#person ⇒ Object
Returns the value of attribute person.
6 7 8 |
# File 'lib/pipedrive_jetrockets/deal.rb', line 6 def person @person end |