PipedrivePUT 1.1.9 → 1.1.10

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: af57984f4afd652f8779c9a6046963ce2052d90b
4
- data.tar.gz: d7428d8e1d1fbc9308df7fddffc7695a9c2dba61
3
+ metadata.gz: 287a43d08873a0d3c2b0033f8591015b3a7c688c
4
+ data.tar.gz: 83b4286554434695a75faf7710277e5b6d9afa59
5
5
  SHA512:
6
- metadata.gz: f482e6d0aabbf08b7192cf9383bda44be85b6851d7d20db9a23707f7e097cee44466b2777279492bdac6bf4f258c33b86ced4f04b4efaaa87ecea1407274f9a6
7
- data.tar.gz: 109f4ccbcf93333387dcc1af620dfecc15d385855e1f8af4def83f61d1916c1df39af55ef6165e071d9c11647a97adb54ad162baed9481563368d079ffdf8e9f
6
+ metadata.gz: b0619ad182ad39d0d3b441793739447adbddc764561129d190862a1013a2bc0e1b3bec8bd18ba8ca4fdfcbcabcac1143b87f8af9d0d6d758e283cb83523b44af
7
+ data.tar.gz: 5766b013f4403a649eab621b600c4cb367259dbcea347ae2f0d32e4a6f023765047780bf886939ab84fcb78da51703f972e42337ae813719055ddd04cc6741dd
data/README.md CHANGED
@@ -42,6 +42,29 @@ Add an organization
42
42
  PipedrivePUT::Organizations.addOrganization(< Name of new Organization >)
43
43
  ```
44
44
 
45
+ You can also add various other parameters based on values in Pipedrive or custom keys when creating a organization!
46
+
47
+
48
+ ```ruby
49
+ PipedrivePUT::Organizations.addOrganization(< Name of new Organization >, < :optionArgument => "value" > )
50
+ ```
51
+
52
+ NOTE: the options must be in hash format
53
+
54
+ Example:
55
+
56
+ ```ruby
57
+ PipedrivePUT::Organizations.addOrganization("Jacob Programming Test", :address => "South Jasmine Street")
58
+ ```
59
+
60
+ You can aso add ANY custom key from Pipedrive to this to input values into those fields
61
+
62
+ Example:
63
+
64
+ ```ruby
65
+ PipedrivePUT::Organizations.addOrganization("Jacob Programming Test", :'3df8474115f948137b3f98a0ff651d0edbbd2f54' => "JMD")
66
+ ```
67
+
45
68
  Find Organization by term
46
69
 
47
70
  ```ruby
@@ -131,13 +154,9 @@ This is my first attempt at a ruby gem so I appoligize if things are unorthodox.
131
154
  ## To do List
132
155
 
133
156
 
134
- 1. Add support for additional arguments to create an organization
135
-
136
- 2. Get All Deals
137
-
138
- 3. Add a deal
157
+ 1. Add support for additional arguments when creating a deal
139
158
 
140
- 4. Many other Pipedrive API Calls
159
+ 2. Many other Pipedrive API Calls
141
160
 
142
161
 
143
162
  ## Contributing
@@ -3,7 +3,7 @@ module PipedrivePUT
3
3
 
4
4
  include PipedrivePUT
5
5
 
6
-
6
+ require 'rest-client'
7
7
  def self.key
8
8
  puts @@key
9
9
  end
@@ -43,18 +43,21 @@ include PipedrivePUT
43
43
 
44
44
 
45
45
  #Add an organization
46
- #TO DO: Add optional *args full functionality
47
- def self.addOrganization(name, *args)
48
- args.each_with_index{ |arg, i| puts "#{i+1}. #{arg}" }
46
+ def self.addOrganization(companyName, options = {})
47
+ #args.each_with_index{ |arg, i| puts "#{i+1}. #{arg}" }
49
48
 
50
- if (args.size > 1)
51
- raise "Only takes one additional Params (<Organization Name>, <Owner ID>)"
52
- end
49
+ uri = URI.parse('https://api.pipedrive.com/v1/organizations?api_token=' + @@key.to_s)
50
+
51
+ if (!options.nil?)
53
52
 
54
- @base = 'https://api.pipedrive.com/v1/organizations?api_token=' + @@key.to_s
53
+ options.merge!(:name => companyName)
54
+
55
+ puts options
56
+
57
+ response = Net::HTTP.post_form(uri, options)
58
+ end
55
59
 
56
60
 
57
- RestClient.post @base.to_s, { "name" => name }.to_json, :content_type => :json, :accept => :json
58
61
 
59
62
  end
60
63
 
@@ -1,3 +1,3 @@
1
1
  module PipedrivePUT
2
- VERSION = "1.1.9"
2
+ VERSION = "1.1.10"
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.9
4
+ version: 1.1.10
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-11 00:00:00.000000000 Z
11
+ date: 2015-06-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler