coins_ph_ruby 0.1.1 → 0.1.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a8f24899d2db5184fe834d559e29154562c0c04f
4
- data.tar.gz: 3a0d39fd672df2b59625f7e7d50b14b7d39f8a7f
3
+ metadata.gz: 9e2a66fea27f05f06e6b9b9f7ad30ff7ed749601
4
+ data.tar.gz: bc74f21dc31556182f7cb8e91bd37723a80572a9
5
5
  SHA512:
6
- metadata.gz: d3ff0e4beda81fcfe2375562286ef155375e277f310ea77ef0ea3ec36fb3701eb2cb695e4651e2863d9c2466637dc461c33d6aba5845f3ce103c2ac7df2e18b2
7
- data.tar.gz: 4e131daa1e504260b6688599124463a7ca4dbe8e121e4490c8624108df1b4262f5e63e51450ab4f7d316b549a4137640e4bc8f1089e77249b7a004239143e2c0
6
+ metadata.gz: cafe791b31aa96daf566431cd412f769fd01645ca19d429f1b8253f6ac5b9578449e2e69d1ea7027d2c5c35e2248624af5cb0d33e105d837cff6fa37bb479e2b
7
+ data.tar.gz: d2b31a9148f26603a330f36108a9189bef0a2363303fea021afdccc1cfe67e39722b17f039fe3b400dcd6f672aca83b339a98d371337faf5b31e4ddc9468c43a
data/.gitignore CHANGED
@@ -8,7 +8,7 @@
8
8
  /spec/reports/
9
9
  /tmp/
10
10
  .idea/
11
- coins_ph_ruby-0.1.0.gem
11
+ *.gem
12
12
 
13
13
  # rspec failure tracking
14
14
  .rspec_status
@@ -1,3 +1,3 @@
1
1
  module CoinsPhRuby
2
- VERSION = "0.1.1"
2
+ VERSION = "0.1.2"
3
3
  end
data/lib/coins_ph_ruby.rb CHANGED
@@ -8,26 +8,26 @@ module CoinsPhRuby
8
8
  class CoinsPhService
9
9
 
10
10
  def initialize(api_key, api_secret)
11
- @API_KEY = api_key
12
- @API_SECRET = api_secret
13
- @BASE_URL = 'https://coins.ph/api/v3'
14
- @conn = Faraday.new @BASE_URL do |connector|
11
+ @api_key = api_key
12
+ @api_secret = api_secret
13
+ @base_url = 'https://coins.ph/api/v3'
14
+ @conn = Faraday.new @base_url do |connector|
15
15
  connector.use FaradayMiddleware::FollowRedirects
16
16
  connector.adapter Faraday.default_adapter
17
17
  end
18
18
  end
19
19
 
20
20
  def get_crypto_accounts(currency=nil)
21
- url = BASE_URL + "/crypto-accounts/"
21
+ url = @base_url + "/crypto-accounts/"
22
22
  nonce = Hmac.get_nonce.to_s
23
- signature = Hmac.sign_request(@API_SECRET, url, nonce)
23
+ signature = Hmac.sign_request(@api_secret, url, nonce)
24
24
 
25
25
  response = @conn.get do |req|
26
26
  req.url 'crypto-accounts'
27
27
  req.headers['Content-Type'] = 'application/json'
28
28
  req.headers['Accept'] = 'application/json'
29
29
  req.headers['ACCESS_SIGNATURE'] = signature
30
- req.headers['ACCESS_KEY'] = @API_KEY
30
+ req.headers['ACCESS_KEY'] = @api_key
31
31
  req.headers['ACCESS_NONCE'] = nonce
32
32
  end
33
33
 
@@ -37,14 +37,14 @@ module CoinsPhRuby
37
37
 
38
38
  def get_transfers(id=nil)
39
39
  nonce = Hmac.get_nonce.to_s
40
- url = BASE_URL + "/transfers"
40
+ url = @base_url + "/transfers"
41
41
 
42
42
  response = @conn.get do |req|
43
43
  req.url 'transfers'
44
44
  req.headers['Content-Type'] = 'application/json'
45
45
  req.headers['Accept'] = 'application/json'
46
- req.headers['ACCESS_SIGNATURE'] = Hmac.sign_request(@API_SECRET, url, nonce)
47
- req.headers['ACCESS_KEY'] = @API_KEY
46
+ req.headers['ACCESS_SIGNATURE'] = Hmac.sign_request(@api_secret, url, nonce)
47
+ req.headers['ACCESS_KEY'] = @api_key
48
48
  req.headers['ACCESS_NONCE'] = nonce
49
49
  end
50
50
 
@@ -61,15 +61,15 @@ module CoinsPhRuby
61
61
  }"
62
62
 
63
63
  nonce = Hmac.get_nonce.to_s
64
- url = BASE_URL + "/transfers"
64
+ url = @base_url + "/transfers"
65
65
 
66
66
  response = @conn.post do |req|
67
67
  req.url 'transfers'
68
68
  req.headers['Content-Type'] = 'application/json'
69
69
  req.headers['Accept'] = 'application/json'
70
70
 
71
- req.headers['ACCESS_SIGNATURE'] = Hmac.sign_request(@API_SECRET, url, nonce, body)
72
- req.headers['ACCESS_KEY'] = @API_KEY
71
+ req.headers['ACCESS_SIGNATURE'] = Hmac.sign_request(@api_secret, url, nonce, body)
72
+ req.headers['ACCESS_KEY'] = @api_key
73
73
  req.headers['ACCESS_NONCE'] = nonce
74
74
 
75
75
  req.body = body
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: coins_ph_ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - jcdjulian