pipedrive_jetrockets 0.0.56 → 0.0.57

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 67850907e5a56321bb9b2940ca76d6adad7b5fb5a0e565f681c1819aa8a6d144
4
- data.tar.gz: 4c40f18993ada54bc6d6295a96413b89aee292facd13178f9e6232e59f46f5d0
3
+ metadata.gz: 583df65d47a9f1c956cb65575f163331e673952d9bc2b2b500bda29350a98487
4
+ data.tar.gz: d4033ef8c9a8a6d03dbeff552a13cad3646b7332fc8455ebf51bb84ffe0fa462
5
5
  SHA512:
6
- metadata.gz: c9a5ea7e4e0dd1bbc597f2080fec31b4f87e82e79c594ce4f6ca2725d0ce2724639866253ee0528482e15682000cd054aa93fde008bf77bfd7f984eb8ba7c9b6
7
- data.tar.gz: f62855fb63e7a70ac1a7e91f6941a0bebddb6f07e2fe2c402498d3e275db66091cc9750ab884f8a37e79a21ab21942c713d2f1d54950bfc1bb9aa47d2093bcf0
6
+ metadata.gz: 0da87b81c1c44dbb22cd9f674d3c49e04501b7ad14534133e304abaad563943b20947e0a0962262d26aa28c5d00033afe32deff6a280a08d491aad358593b288
7
+ data.tar.gz: e29db41c25403501bb16cae53ea746ae075e3643152bf1c914fcb5624f5882fa2739596e5e477917202b1bc23f3df6be7dad4472a4bc51b5ff209cb8c706d1ab
@@ -1,10 +1,19 @@
1
1
  module PipedriveJetrockets
2
2
  class Organization < Entity
3
- attr_accessor :id, :name, :owner_id, :address, :cc_email, :add_time, :update_time
3
+ attr_accessor :id, :name, :owner_id, :address, :cc_email, :add_time, :update_time,
4
+ :closed_deals_count
4
5
 
5
6
  def initialize(hash)
6
- super
7
+ @@key_name_hash ||= Pipedrive.organization_fields.key_name_hash
8
+ super(hash.except(*@@key_name_hash.keys))
7
9
  @id = hash['value'] if hash['value'].present?
10
+
11
+ @@key_name_hash.each do |key, name|
12
+ name = name.underscore.gsub(' ','_')
13
+ name = name.gsub('%','percent').gsub(/[^a-zA-Z0-9_]/,'')
14
+ instance_variable_set("@#{name}", hash[key])
15
+ Organization.class_eval {attr_accessor name}
16
+ end
8
17
  end
9
18
  end
10
19
  end
@@ -0,0 +1,5 @@
1
+ module PipedriveJetrockets
2
+ class OrganizationField < Entity
3
+ attr_accessor :id, :key, :name
4
+ end
5
+ end
@@ -3,6 +3,7 @@ require 'pipedrive_jetrockets/deal'
3
3
  require 'pipedrive_jetrockets/deal_field'
4
4
  require 'pipedrive_jetrockets/note'
5
5
  require 'pipedrive_jetrockets/organization'
6
+ require 'pipedrive_jetrockets/organization_field'
6
7
  require 'pipedrive_jetrockets/person'
7
8
  require 'pipedrive_jetrockets/pipeline'
8
9
  require 'pipedrive_jetrockets/stage'
@@ -23,6 +23,10 @@ class Pipedrive
23
23
  @@organizations_service ||= PipedriveJetrockets::Service.new('organization')
24
24
  end
25
25
 
26
+ def self.organization_fields
27
+ @@deal_fields_service ||= PipedriveJetrockets::FieldService.new('organizationField')
28
+ end
29
+
26
30
  def self.persons
27
31
  @@persons_service ||= PipedriveJetrockets::PersonService.new('person')
28
32
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pipedrive_jetrockets
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.56
4
+ version: 0.0.57
5
5
  platform: ruby
6
6
  authors:
7
7
  - Agafonov Maksim
@@ -41,6 +41,7 @@ files:
41
41
  - lib/pipedrive_jetrockets/field_service.rb
42
42
  - lib/pipedrive_jetrockets/note.rb
43
43
  - lib/pipedrive_jetrockets/organization.rb
44
+ - lib/pipedrive_jetrockets/organization_field.rb
44
45
  - lib/pipedrive_jetrockets/person.rb
45
46
  - lib/pipedrive_jetrockets/person_service.rb
46
47
  - lib/pipedrive_jetrockets/pipeline.rb