PipedrivePUT 1.1.7 → 1.1.8

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 380ff0c69aecb23dc2e5a55e4c615d09cf6ca442
4
- data.tar.gz: cf2eef758e97b19692ae13aee65dfa460aa5a19e
3
+ metadata.gz: f2178019def9566ab6649aaf85ef4f5a09bf450c
4
+ data.tar.gz: 9ff6538a2b4f50c47f3419807562c1d37464d79d
5
5
  SHA512:
6
- metadata.gz: f1d0024b0bfcbce86a5435fefa6e984e562f99acadb60be2b162c10d4d0f8caf03d6e30d570e16b6e7f397e05c8fa0eed60f90e08a4720471c1f0e2b656d0dcc
7
- data.tar.gz: 447b4e0a7f87f4125ce99f30950068e5a07ef3afc349ae61537b8fd940200bdaa42a45a839ec827dc246aea02a1bac6ecc6997e962e19420a94ce833d3c1fd0e
6
+ metadata.gz: 25388901a36076a7e8175fb1874929264bb0b8c68a6b2e582609dfc5960cd3d84a0d269ac238cacbc6be4c16289a02485740054e8a5733dc6e9a0766dd9d0245
7
+ data.tar.gz: e6c3a0b6bd3f52a254e57ce5b1ae8cf7fb79a7dfab14a7c7024ec7410b619957a7c1fdc710d669736bf2c26e578284192e8fb1e6db23bd358f4991091ca1cc12
data/README.md CHANGED
@@ -48,6 +48,12 @@ Find Organization by term
48
48
  PipedrivePUT::Organizations.findOrganizationByName(< Term >)
49
49
  ```
50
50
 
51
+ Find Persons in an Organization
52
+ ```ruby
53
+ PipedrivePUT::Organizations.getPersonsOfOrganization(< id >)
54
+ ```
55
+
56
+
51
57
  ## Deals
52
58
 
53
59
  Get Specific Deal with ID
@@ -99,6 +99,37 @@ include PipedrivePUT
99
99
  end
100
100
 
101
101
 
102
+ #Get Persons of an Organization
103
+ def self.getPersonsOfOrganization(id)
104
+ @start = 0
105
+
106
+ table = Array.new
107
+ @more_items = true
108
+ tablesize = 0
109
+
110
+ while @more_items == true do
111
+ count = 0
112
+
113
+ @base = 'https://api.pipedrive.com/v1/organizations/' + id.to_s + '/persons?&start=' + @start.to_s + '&limit=500&api_token=' + @@key.to_s
114
+
115
+ @content = open(@base.to_s).read
116
+ @parsed = JSON.parse(@content)
117
+
118
+ while count < @parsed["data"].size
119
+ #table.push(@parsed["data"][count])
120
+ table[tablesize] = @parsed["data"][count]
121
+ count = count +1
122
+ tablesize = tablesize + 1
123
+
124
+ end
125
+ @pagination = @parsed['additional_data']['pagination']
126
+ @more_items = @pagination['more_items_in_collection']
127
+ #puts @more_items
128
+ @start = @pagination['next_start']
129
+ #puts @start
130
+ end
131
+ return table
132
+ end
102
133
 
103
134
  end
104
135
  end
@@ -1,3 +1,3 @@
1
1
  module PipedrivePUT
2
- VERSION = "1.1.7"
2
+ VERSION = "1.1.8"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: PipedrivePUT
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.7
4
+ version: 1.1.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - JakePens71
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-06-05 00:00:00.000000000 Z
11
+ date: 2015-06-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler