doge_api 0.0.5 → 0.0.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/doge/api.rb +11 -2
  3. metadata +5 -5
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4a59e01ba31bd1ced607b637a06c1abef101b245
4
- data.tar.gz: 2e42764188e8d0701a9c323ba05d0bc00f7a16a5
3
+ metadata.gz: f4b13440b1162323dec2e9acdda92b06db058f66
4
+ data.tar.gz: 5102e035a7be2a90f7ed053f101681449aba9827
5
5
  SHA512:
6
- metadata.gz: 53b2a702418b19c50624fbf9174ee6ce2e2ae79b3467215e209b29061e1591541b8bb2c3d2fb6c4f7dae13d1541e1cb5d9a2eac4bc9fb20c980668c6c69b7665
7
- data.tar.gz: 5ed23498cd803e1eb8aad522c72ecc504babcadbfc7928b95db5573edd1c361ba5921efdd20bb7653c631fb8404fde697158c8cdf22a26d2a37118fb17aa4ea2
6
+ metadata.gz: d0275dda1d2007e107eda5c2bf4b4549400ea8eca5b3701dce7b0749345c068d4ccaed9ee9a77a3087c21b59b4819a2117c7c13fbf9716c2a3e7c56483f9df89
7
+ data.tar.gz: 726a24c2433e25d4040b386cb5353a18bdcea3c067fe04d5acda7af372ac5cc6cd71952e833762832419793c25a8f876cefde4dd43c8600964afb7e92ca37bcd
data/lib/doge/api.rb CHANGED
@@ -5,9 +5,10 @@ module DogeApi
5
5
  class DogeApi
6
6
  attr_accessor :api_key
7
7
 
8
- def initialize(api_key)
8
+ def initialize(api_key, version=1)
9
9
  @api_key = api_key
10
- @base_uri = URI.parse('https://www.dogeapi.com/wow')
10
+ @api_version = version
11
+ @base_uri = URI.parse(_get_dogeapi_endpoint())
11
12
  end
12
13
 
13
14
  def build_uri(m, args)
@@ -24,5 +25,13 @@ module DogeApi
24
25
  def method_missing(m, args = {}, &block)
25
26
  fetch_uri build_uri(m, args)
26
27
  end
28
+
29
+ private
30
+
31
+ def _get_dogeapi_endpoint()
32
+ base_uri = 'https://www.dogeapi.com/wow'
33
+ base_uri += '/v2' if @api_version == 2
34
+ return base_uri
35
+ end
27
36
  end
28
37
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: doge_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Maxwell Bernstein
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-01-26 00:00:00.000000000 Z
11
+ date: 2014-02-27 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description:
14
14
  email: dogeapi@bernsteinbear.com
@@ -16,9 +16,9 @@ executables: []
16
16
  extensions: []
17
17
  extra_rdoc_files: []
18
18
  files:
19
- - lib/doge_api.rb
20
19
  - lib/doge/api.rb
21
20
  - lib/doge/chain.rb
21
+ - lib/doge_api.rb
22
22
  homepage: http://github.com/tekknolagi/doge_api
23
23
  licenses:
24
24
  - MIT
@@ -39,8 +39,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
39
39
  version: '0'
40
40
  requirements: []
41
41
  rubyforge_project:
42
- rubygems_version: 2.0.4
42
+ rubygems_version: 2.2.2
43
43
  signing_key:
44
44
  specification_version: 4
45
- summary: Ruby wrapper for DogeAPI.com and DogeChain.info
45
+ summary: Ruby wrapper for DogeAPI.com (now with v2!) and DogeChain.info
46
46
  test_files: []