PipedrivePUT 1.1.6 → 1.1.7

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: b5cbee4fe3a3bfcf7bd03c8bde173cff31b5240f
4
- data.tar.gz: 7c7f6137098c34dab3a743a58031ed4a72617c55
3
+ metadata.gz: 380ff0c69aecb23dc2e5a55e4c615d09cf6ca442
4
+ data.tar.gz: cf2eef758e97b19692ae13aee65dfa460aa5a19e
5
5
  SHA512:
6
- metadata.gz: 50bd49519b1e0957ac232afadc5c235b14a7ea01785bab06c8b61004087cff1bafbebec7b0603b241c18b5f0e31546099564f2f6081ced46b06d1ef9d12c7c43
7
- data.tar.gz: 9901db9b6bcc442e079adf44f413de0381258865f192a23402b147bb449fbd91a5c71ace981536df8881fa52c5b488d05b33abd75e944e4f38fc52bd7fd1c13c
6
+ metadata.gz: f1d0024b0bfcbce86a5435fefa6e984e562f99acadb60be2b162c10d4d0f8caf03d6e30d570e16b6e7f397e05c8fa0eed60f90e08a4720471c1f0e2b656d0dcc
7
+ data.tar.gz: 447b4e0a7f87f4125ce99f30950068e5a07ef3afc349ae61537b8fd940200bdaa42a45a839ec827dc246aea02a1bac6ecc6997e962e19420a94ce833d3c1fd0e
data/README.md CHANGED
@@ -90,6 +90,32 @@ Get All users for your company
90
90
  PipedrivePUT::Users.getAllUsers
91
91
  ```
92
92
 
93
+ ## Persons
94
+
95
+ Get all persons from Pipedrive
96
+ ```ruby
97
+ PipedrivePUT::Persons.getAllPersons
98
+ ```
99
+
100
+ Get specifi Person from Pipedrive
101
+
102
+ ```ruby
103
+ PipedrivePUT::Persons.detailsOfPerson(< id >)
104
+ ```
105
+
106
+ ## Pipelines
107
+
108
+ Get all Pipelines
109
+ ```ruby
110
+ PipedrivePUT::Pipelines.getAllPipelines
111
+ ```
112
+
113
+ Get one Pipeline
114
+ ```ruby
115
+ PipedrivePUT::Pipelines.getOnePipeline(< id >)
116
+ ```
117
+
118
+
93
119
  Data is returned in JSON format.
94
120
 
95
121
  This can be easily customized. I needed something quickly and easily for my own personal project.
@@ -3,6 +3,8 @@ require "PipedrivePUT/organization"
3
3
  require 'PipedrivePUT/search'
4
4
  require 'PipedrivePUT/users'
5
5
  require 'PipedrivePUT/deal'
6
+ require 'PipedrivePUT/persons'
7
+ require 'PipedrivePUT/pipelines'
6
8
 
7
9
  require 'json'
8
10
  require 'open-uri'
@@ -0,0 +1,51 @@
1
+ module PipedrivePUT
2
+ class Persons
3
+ include PipedrivePUT
4
+
5
+ #Gets all persons in pipedrive
6
+ def self.getAllPersons
7
+ @start = 0
8
+
9
+ table = Array.new
10
+ @more_items = true
11
+ tablesize = 0
12
+ while @more_items == true do
13
+ count = 0
14
+ #puts @more_items
15
+ @base = 'https://api.pipedrive.com/v1/persons?start=' + @start.to_s + '&limit=500&api_token=' + @@key.to_s
16
+ #puts @base
17
+ @content = open(@base.to_s).read
18
+ @parsed = JSON.parse(@content)
19
+
20
+ while count < @parsed["data"].size
21
+ #table.push(@parsed["data"][count])
22
+ table[tablesize] = @parsed["data"][count]
23
+ count = count +1
24
+ tablesize = tablesize + 1
25
+ end
26
+
27
+ @pagination = @parsed['additional_data']['pagination']
28
+ @more_items = @pagination['more_items_in_collection']
29
+ #puts @more_items
30
+ @start = @pagination['next_start']
31
+ #puts @start
32
+ end
33
+
34
+ return table
35
+
36
+ end
37
+
38
+
39
+ #Gets details of a signle person with id being passed in at params.
40
+ def self.detailsOfPerson(id)
41
+ @base = 'https://api.pipedrive.com/v1/persons/' + id.to_s + '?start=' + @start.to_s + '&limit=500&api_token=' + @@key.to_s
42
+ @content = open(@base.to_s).read
43
+ @parsed = JSON.parse(@content)
44
+
45
+ end
46
+
47
+
48
+
49
+ end
50
+
51
+ end
@@ -0,0 +1,46 @@
1
+ module PipedrivePUT
2
+ class Pipelines
3
+
4
+ include PipedrivePUT
5
+
6
+ def self.getAllPipelines
7
+ @start = 0
8
+
9
+ table = Array.new
10
+ @more_items = true
11
+ tablesize = 0
12
+ while @more_items == true do
13
+ count = 0
14
+ #puts @more_items
15
+ @base = 'https://api.pipedrive.com/v1/pipelines?api_token=' + @@key.to_s
16
+ #puts @base
17
+ @content = open(@base.to_s).read
18
+ @parsed = JSON.parse(@content)
19
+
20
+ while count < @parsed["data"].size
21
+ #table.push(@parsed["data"][count])
22
+ table[tablesize] = @parsed["data"][count]
23
+ count = count +1
24
+ tablesize = tablesize + 1
25
+ end
26
+
27
+ @pagination = @parsed['additional_data']['pagination']
28
+ @more_items = @pagination['more_items_in_collection']
29
+ #puts @more_items
30
+ @start = @pagination['next_start']
31
+ #puts @start
32
+ end
33
+
34
+ return table
35
+ end
36
+
37
+ def self.getOnePipeline(id)
38
+ @base = 'https://api.pipedrive.com/v1/pipelines/' + id.to_s + '?api_token=' + @@key.to_s
39
+ #puts @base
40
+ @content = open(@base.to_s).read
41
+ @parsed = JSON.parse(@content)
42
+ end
43
+
44
+ end
45
+
46
+ end
@@ -1,3 +1,3 @@
1
1
  module PipedrivePUT
2
- VERSION = "1.1.6"
2
+ VERSION = "1.1.7"
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.6
4
+ version: 1.1.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - JakePens71
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-05-31 00:00:00.000000000 Z
11
+ date: 2015-06-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -108,6 +108,8 @@ files:
108
108
  - lib/PipedrivePUT.rb
109
109
  - lib/PipedrivePUT/deal.rb
110
110
  - lib/PipedrivePUT/organization.rb
111
+ - lib/PipedrivePUT/persons.rb
112
+ - lib/PipedrivePUT/pipelines.rb
111
113
  - lib/PipedrivePUT/search.rb
112
114
  - lib/PipedrivePUT/users.rb
113
115
  - lib/PipedrivePUT/version.rb
@@ -131,7 +133,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
131
133
  version: '0'
132
134
  requirements: []
133
135
  rubyforge_project:
134
- rubygems_version: 2.4.6
136
+ rubygems_version: 2.4.5
135
137
  signing_key:
136
138
  specification_version: 4
137
139
  summary: Pipedrive gem to retrieve data from Pipedrive.com