Class: PipeRocket::Organization

Inherits:
Entity
  • Object
show all
Defined in:
lib/pipe_rocket/organization.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Entity

#assign_custom_fields, #transform_field_name

Constructor Details

#initialize(hash) ⇒ Organization

Returns a new instance of Organization.



10
11
12
13
14
# File 'lib/pipe_rocket/organization.rb', line 10

def initialize(hash)
  super(hash.except(*Organization.key_field_hash.keys))
  @id = hash['value'] if hash['value'].present?
  assign_custom_fields(Organization.key_field_hash, hash)
end

Instance Attribute Details

#idObject

Returns the value of attribute id.



3
4
5
# File 'lib/pipe_rocket/organization.rb', line 3

def id
  @id
end

Class Method Details

.key_field_hashObject

Returns hash PipeRocket::Field object



6
7
8
# File 'lib/pipe_rocket/organization.rb', line 6

def self.key_field_hash
  @@key_field_hash ||= Pipedrive.organization_fields.key_field_hash
end