dc_address_lookup 0.1.2 → 0.1.3

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: 65b528d6fff330c560ceb1e7b701ad4cfa8de5d2
4
- data.tar.gz: 19cc3d098728831e849a54d4a04b3e21af068900
3
+ metadata.gz: ecafaf95087d3d0a00ab755e742f8f553992f3bd
4
+ data.tar.gz: 3bca8afb6744cf95620e3ff32443420acf811a86
5
5
  SHA512:
6
- metadata.gz: 18e8242356f504446f0af23c2bfeab34c09d1edc4b98232770aa91ae513d23514022e02ad6eefc7fcedd2f8bce9c40229107b6c51ee778663e140662b8964e35
7
- data.tar.gz: 1e663e180b71061effd999b67ca19ce2c398c2c7f46e20ad341e97726e59ad827f59cb8da57242edb7b8050e6e4ccb2987970bca1def4b32335c9fdb2951a04d
6
+ metadata.gz: 12fdd8072208eaa7126d94e89604a4d133c65fbab4a857356e76e9041e9b51fccab0899fe057c8a70a8688ac6e2caa5ffbb8958fe788fd2828644bdb8984f003
7
+ data.tar.gz: 111901812f132a51770f86d7c15cb404d762c4abe330169a0ea53ee9775b9373f8bc84fd07ebe59d278af92e33bd60c454f8077aca1be54f16b241807370c61d
@@ -2,7 +2,8 @@ module DcAddressLookup
2
2
  class Client
3
3
  def lookup(query)
4
4
  response = RestClient.get DcAddressLookup::ENDPOINT, { params: { str: query } }
5
- Response.new(response).location
5
+ location = Response.new(response).location
6
+ location if location.valid?
6
7
  end
7
8
  end
8
9
  end
@@ -15,6 +15,10 @@ module DcAddressLookup
15
15
  location
16
16
  end
17
17
 
18
+ def valid?
19
+ !(data.empty?)
20
+ end
21
+
18
22
  def method_missing(method_sym, *arguments, &block)
19
23
  if has_property?(method_sym)
20
24
  data[method_sym.to_s]
@@ -1,3 +1,3 @@
1
1
  module DcAddressLookup
2
- VERSION = "0.1.2"
2
+ VERSION = "0.1.3"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dc_address_lookup
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ben Balter