pipedrive-ruby 0.2.1 → 0.2.2

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.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.2.1
1
+ 0.2.2
@@ -47,7 +47,7 @@ module Pipedrive
47
47
  # @param [Hash] attributes
48
48
  # @return [CloudApp::Base]
49
49
  def initialize(attrs = {})
50
- super( attrs['data'].is_a?(Hash) ? attrs['data'] : attrs['data'].first )
50
+ super( attrs['data'].is_a?(Hash) ? attrs['data'] : (attrs['data'].first unless attrs['data'].nil?) )
51
51
  end
52
52
 
53
53
  end
@@ -21,8 +21,8 @@ module Pipedrive
21
21
  end
22
22
  end
23
23
 
24
- def self.find_by_name(name)
25
- res = get "/organizations/find?term=#{name}"
24
+ def self.find_by_name(opts = {})
25
+ res = get "/organizations/find", :query => opts
26
26
  if res.ok?
27
27
  Organization.new(res)
28
28
  else
@@ -21,6 +21,15 @@ module Pipedrive
21
21
  end
22
22
  end
23
23
 
24
+ def self.find_by_name(opts = {})
25
+ res = get "/persons/find", :query => opts
26
+ if res.ok?
27
+ Person.new(res)
28
+ else
29
+ bad_response(res)
30
+ end
31
+ end
32
+
24
33
  end
25
34
 
26
35
  end
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "pipedrive-ruby"
8
- s.version = "0.2.1"
8
+ s.version = "0.2.2"
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"]
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.1
4
+ version: 0.2.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -145,7 +145,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
145
145
  version: '0'
146
146
  segments:
147
147
  - 0
148
- hash: 2055540510164729072
148
+ hash: -3661717696348220238
149
149
  required_rubygems_version: !ruby/object:Gem::Requirement
150
150
  none: false
151
151
  requirements: