PipedrivePUT 1.1.2 → 1.1.3

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
  SHA1:
3
- metadata.gz: dc1306a22f48dc1d8fa61b27919a97d9441f26c8
4
- data.tar.gz: 627fb5864a39486f2c8b0f33c584c123e4cb20fc
3
+ metadata.gz: 1dcba20de85601bc400c08de08a1d91117e173df
4
+ data.tar.gz: b4b302a49f207ed91271efbc3da037d6350ced5a
5
5
  SHA512:
6
- metadata.gz: fe58e6dc1d7f084aa63c9547827d24429242bd33d75586880be20ed8e31d9bee3425725842335f228756271c969019923126e0d289624eda54bd9f2e318c8656
7
- data.tar.gz: b4eaf6324f8ff89138564eff876b08ea0aa3b91dfd30498739c541bc79c160a4a9c5052b9df2354f597ce4a4752003467bbc3fcf226f8aa9e916ba8ec59578a5
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
- @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
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
 
@@ -1,3 +1,3 @@
1
1
  module PipedrivePUT
2
- VERSION = "1.1.2"
2
+ VERSION = "1.1.3"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: PipedrivePUT
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.2
4
+ version: 1.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - JakePens71