PipedrivePUT 1.1.2 → 1.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +7 -1
- data/lib/PipedrivePUT/organization.rb +36 -4
- data/lib/PipedrivePUT/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1dcba20de85601bc400c08de08a1d91117e173df
|
4
|
+
data.tar.gz: b4b302a49f207ed91271efbc3da037d6350ced5a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2983ce3b9d1f1af34497e728800afc79bb8b319da7efbe2a03e952381af2b7dda6bfbc53bc4cb02568e707acefbcee3956e7c4de8c60ec5a9a9ece3ee5fdbcaa
|
7
|
+
data.tar.gz: 14ff8135299ab3af76800ce2202e819cdc6a4d4cec167f8d5e0ee94a96b7b5295ad592878d7160fc9ecf9bd84fe29ba240e79762aeef4b1140963d4d3eb4f8a8
|
data/README.md
CHANGED
@@ -32,7 +32,7 @@ Get all organizations from your account at Pipedrive
|
|
32
32
|
|
33
33
|
Get Organization by ID
|
34
34
|
```ruby
|
35
|
-
PipedrivePUT::Organizations.getOrganization(<id>)
|
35
|
+
PipedrivePUT::Organizations.getOrganization(< id >)
|
36
36
|
```
|
37
37
|
|
38
38
|
|
@@ -42,6 +42,12 @@ Add an organization
|
|
42
42
|
PipedrivePUT::Organizations.addOrganization(< Name of new Organization >)
|
43
43
|
```
|
44
44
|
|
45
|
+
Find Organization by term
|
46
|
+
|
47
|
+
```ruby
|
48
|
+
PipedrivePUT::Organizations.findOrganizationByName(< Term >)
|
49
|
+
```
|
50
|
+
|
45
51
|
## Deals
|
46
52
|
|
47
53
|
Get Specific Deal with ID
|
@@ -60,10 +60,42 @@ include PipedrivePUT
|
|
60
60
|
|
61
61
|
#Return data of a specific Organization
|
62
62
|
def self.getOrganization(id)
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
63
|
+
@base = 'https://api.pipedrive.com/v1/organizations/' + id.to_s + '?api_token=' + @@key.to_s
|
64
|
+
@content = open(@base.to_s).read
|
65
|
+
@parsed = JSON.parse(@content)
|
66
|
+
return @parsed
|
67
|
+
end
|
68
|
+
|
69
|
+
#Find Organization by name
|
70
|
+
def self.findOrganizationByName(name)
|
71
|
+
@start = 0
|
72
|
+
|
73
|
+
table = Array.new
|
74
|
+
@more_items = true
|
75
|
+
tablesize = 0
|
76
|
+
|
77
|
+
while @more_items == true do
|
78
|
+
count = 0
|
79
|
+
|
80
|
+
@base = 'https://api.pipedrive.com/v1/organizations/find?term=' + name.to_s + '&start=' + @start.to_s + '&limit=500&api_token=' + @@key.to_s
|
81
|
+
|
82
|
+
@content = open(@base.to_s).read
|
83
|
+
@parsed = JSON.parse(@content)
|
84
|
+
|
85
|
+
while count < @parsed["data"].size
|
86
|
+
#table.push(@parsed["data"][count])
|
87
|
+
table[tablesize] = @parsed["data"][count]
|
88
|
+
count = count +1
|
89
|
+
tablesize = tablesize + 1
|
90
|
+
|
91
|
+
end
|
92
|
+
@pagination = @parsed['additional_data']['pagination']
|
93
|
+
@more_items = @pagination['more_items_in_collection']
|
94
|
+
#puts @more_items
|
95
|
+
@start = @pagination['next_start']
|
96
|
+
#puts @start
|
97
|
+
end
|
98
|
+
return table
|
67
99
|
end
|
68
100
|
|
69
101
|
|
data/lib/PipedrivePUT/version.rb
CHANGED