pipedrive-ruby 0.2.2 → 0.2.3
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/lib/pipedrive/base.rb +7 -4
- data/lib/pipedrive/organization.rb +3 -3
- data/lib/pipedrive/person.rb +3 -3
- data/pipedrive-ruby.gemspec +2 -2
- metadata +3 -3
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.2.
|
1
|
+
0.2.3
|
data/lib/pipedrive/base.rb
CHANGED
@@ -32,14 +32,17 @@ module Pipedrive
|
|
32
32
|
# @param [HTTParty::Response] response
|
33
33
|
def self.bad_response(response)
|
34
34
|
if response.class == HTTParty::Response
|
35
|
-
raise response.inspect
|
36
35
|
raise ResponseError, response
|
37
36
|
end
|
38
37
|
raise StandardError, "Unkown error"
|
39
38
|
end
|
40
|
-
|
39
|
+
|
40
|
+
def self.new_list( attrs )
|
41
|
+
attrs['data'].is_a?(Array) ? attrs['data'].map {|data| self.new( 'data' => data ) } : []
|
42
|
+
end
|
43
|
+
|
41
44
|
attr_reader :data
|
42
|
-
|
45
|
+
|
43
46
|
# Create a new CloudApp::Base object.
|
44
47
|
#
|
45
48
|
# Only used internally
|
@@ -47,7 +50,7 @@ module Pipedrive
|
|
47
50
|
# @param [Hash] attributes
|
48
51
|
# @return [CloudApp::Base]
|
49
52
|
def initialize(attrs = {})
|
50
|
-
super( attrs['data']
|
53
|
+
super( attrs['data'] )
|
51
54
|
end
|
52
55
|
|
53
56
|
end
|
@@ -21,10 +21,10 @@ module Pipedrive
|
|
21
21
|
end
|
22
22
|
end
|
23
23
|
|
24
|
-
def self.find_by_name(opts
|
25
|
-
res = get "/organizations/find", :query => opts
|
24
|
+
def self.find_by_name(name, opts={})
|
25
|
+
res = get "/organizations/find", :query => { :term => name }.merge(opts)
|
26
26
|
if res.ok?
|
27
|
-
Organization.
|
27
|
+
Organization.new_list(res)
|
28
28
|
else
|
29
29
|
bad_response(res)
|
30
30
|
end
|
data/lib/pipedrive/person.rb
CHANGED
@@ -21,10 +21,10 @@ module Pipedrive
|
|
21
21
|
end
|
22
22
|
end
|
23
23
|
|
24
|
-
def self.find_by_name(opts
|
25
|
-
res = get "/persons/find", :query => opts
|
24
|
+
def self.find_by_name(name, opts={})
|
25
|
+
res = get "/persons/find", :query => { :term => name }.merge(opts)
|
26
26
|
if res.ok?
|
27
|
-
Person.
|
27
|
+
Person.new_list(res)
|
28
28
|
else
|
29
29
|
bad_response(res)
|
30
30
|
end
|
data/pipedrive-ruby.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = "pipedrive-ruby"
|
8
|
-
s.version = "0.2.
|
8
|
+
s.version = "0.2.3"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Waldemar Kusnezow", "Jan Schwenzien", "Patrick Kozma"]
|
12
|
-
s.date = "2012-11-
|
12
|
+
s.date = "2012-11-04"
|
13
13
|
s.description = "Ruby wrapper for the Pipedrive API"
|
14
14
|
s.email = "jan@general-scripting.com"
|
15
15
|
s.extra_rdoc_files = [
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pipedrive-ruby
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.3
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -11,7 +11,7 @@ authors:
|
|
11
11
|
autorequire:
|
12
12
|
bindir: bin
|
13
13
|
cert_chain: []
|
14
|
-
date: 2012-11-
|
14
|
+
date: 2012-11-04 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: httparty
|
@@ -145,7 +145,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
145
145
|
version: '0'
|
146
146
|
segments:
|
147
147
|
- 0
|
148
|
-
hash: -
|
148
|
+
hash: -274804402541556327
|
149
149
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
150
150
|
none: false
|
151
151
|
requirements:
|