timezonedb-client 0.1.1 → 0.2.0

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: 9c1b6a31168ddf8082ab1fd0ef13189b9e726a74
4
- data.tar.gz: 3ac5d75d09b02f19d3f4f90098b8831b49f6e8b9
3
+ metadata.gz: c271ef10800e475f01ae783a655d5af321275f26
4
+ data.tar.gz: eb0397d50b0fa6e9bfd735650c08b48c51fc25c0
5
5
  SHA512:
6
- metadata.gz: 96111761f756888769b5747a6723e289182147137544b5009263a5e72cebd13dc2621208fff0a53173c2605d15ade4c84249b49f342ed19271380fbdd434b2dc
7
- data.tar.gz: 7176e287393c1c5f2d5b6f3b4facfccc08808b22a8f84cedcec2df9fe2e56cfd750522b80220f899f331b4cd25c1e9e8a18c5223cb54b62782bd37cc902e6e97
6
+ metadata.gz: 1081fedc500f3b2a4e7286b45673ef331ed9e20dfb5626e8c81fc7caec025604942544bbe78df17bbbdb403041aa55e42c78519bcc5c243ed2e18a5a31a58907
7
+ data.tar.gz: 623f3b92ba1b47de9d860bb573c3f1259216c57bc120797e3b5843ff05ec4dcf4f56f6d6ab96f861d6b7ece30d5941995441608f0e48dac0e037bcc6386672ef
data/README.md CHANGED
@@ -54,12 +54,12 @@ tz.zone_name
54
54
  => "Europe/Madrid"
55
55
  ```
56
56
 
57
- If you have premium API access, add `true` as a parameter when instantiating
57
+ If you have premium API access, add `premium: true` as a parameter when instantiating
58
58
  the Timezonedb client, otherwise it will use the free plan endpoint.
59
59
 
60
60
  ```
61
61
  # will call vip.timezonedb.com instead of api.timezonedb.com
62
- client = Timezonedb::Client.new(api_key, true)
62
+ client = Timezonedb::Client.new(api_key, premium: true)
63
63
  ```
64
64
 
65
65
  ## Contributing
@@ -25,8 +25,9 @@ module Timezonedb
25
25
  FREE_URL = 'http://api.timezonedb.com'
26
26
  PREMIUM_URL = 'http://vip.timezonedb.com'
27
27
 
28
- def initialize(api_key, premium = false)
28
+ def initialize(api_key, options = {})
29
29
  @api_key = api_key
30
+ premium = options[:premium]
30
31
  @url = premium ? PREMIUM_URL : FREE_URL
31
32
  end
32
33
 
@@ -16,6 +16,6 @@
16
16
 
17
17
  module Timezonedb
18
18
  class Client
19
- VERSION = '0.1.1'
19
+ VERSION = '0.2.0'
20
20
  end
21
21
  end
@@ -148,7 +148,7 @@ describe Timezonedb::Client do
148
148
  context 'when premium plan' do
149
149
  let(:url) { 'http://vip.timezonedb.com' }
150
150
 
151
- subject { Timezonedb::Client.new(api_key, true).search_by_coords(latitude, longitude) }
151
+ subject { Timezonedb::Client.new(api_key, premium: true).search_by_coords(latitude, longitude) }
152
152
 
153
153
  context 'and successful request' do
154
154
  let(:response_body) { correct_response_body.to_json }
@@ -21,7 +21,7 @@ require 'timezonedb/client/version'
21
21
  Gem::Specification.new do |s|
22
22
  s.name = 'timezonedb-client'
23
23
  s.version = Timezonedb::Client::VERSION
24
- s.date = '2016-01-29'
24
+ s.date = '2016-02-03'
25
25
  s.summary = 'Timezonedb Client'
26
26
  s.description = 'A client for accessing the timezonedb.com API'
27
27
  s.authors = ['Kostis Dadamis', 'Emili Parreno']
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: timezonedb-client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kostis Dadamis
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2016-01-29 00:00:00.000000000 Z
12
+ date: 2016-02-03 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rest-client