coinjar 1.0.0.alpha.1 → 1.0.0.alpha.2

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: e64f5f62668108d8f80d7676718cae632b9ae6c1
4
- data.tar.gz: 96572402ab8699550cf57030cc3a330be47589d4
3
+ metadata.gz: 498843ad4a5a4fef4db6320e83ca78698aef763b
4
+ data.tar.gz: 2f2ff4c8cdca199f88668918e93ce454299fe464
5
5
  SHA512:
6
- metadata.gz: 2e335e2131d37e47721c8a9c084796cf98662413cba2dadad47fd32f6d895d3303e709fc8fd94edaab1bb335191b321fb427ae066bc0785af42b99f777a92f55
7
- data.tar.gz: 5608839d49b99b530edebd9442af5840b59730fee4c454d17a60ce3b252a193e0e2f3a46b19cd3a356c831fb8286935cfac6d1a0df5242e6f6e2702b962cf582
6
+ metadata.gz: 54f08c5c0c87efa4baec48999855696c5db323794473505c44ad51bfd63243ec13946f7a77ecb0460b57be3010b9761d5d2b8fc055bb64eb1eb5e7124d86cf1b
7
+ data.tar.gz: 9f98dff8b97c569a6e3659729123e4daa80ebfaf04022131264fba5a582c446bc542a73c99325cebc3b5798120e214c4d68595a53df78c0251516e2fb78113ea
@@ -0,0 +1,15 @@
1
+ module CoinJar
2
+ class FairRate
3
+
4
+ attr_accessor :currency, :bid, :ask, :spot
5
+
6
+ def initialize(currency = "USD")
7
+ @currency = currency
8
+ response = CoinJar.client.get("fair_rate/" + currency)
9
+ @bid = BigDecimal.new response[:bid]
10
+ @ask = BigDecimal.new response[:ask]
11
+ @spot = BigDecimal.new response[:spot]
12
+ end
13
+
14
+ end
15
+ end
@@ -20,7 +20,7 @@ module CoinJar
20
20
  end
21
21
 
22
22
  def fetch
23
- CoinJar.client.get("payments/" + uuid)[:payment]
23
+ response = CoinJar.client.get("payments/" + uuid)
24
24
  self.reset(response[:payment])
25
25
  self
26
26
  end
@@ -1,3 +1,3 @@
1
1
  module CoinJar
2
- VERSION = "1.0.0.alpha.1"
2
+ VERSION = "1.0.0.alpha.2"
3
3
  end
data/lib/coinjar.rb CHANGED
@@ -8,6 +8,7 @@ require 'coinjar/client'
8
8
  require 'coinjar/address'
9
9
  require 'coinjar/payment'
10
10
  require 'coinjar/transaction'
11
+ require 'coinjar/fair_rate'
11
12
 
12
13
  module CoinJar
13
14
  extend Configuration
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: coinjar
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0.alpha.1
4
+ version: 1.0.0.alpha.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - CoinJar Pty Ltd
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2013-05-14 00:00:00.000000000 Z
13
+ date: 2013-05-16 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: bundler
@@ -99,6 +99,7 @@ files:
99
99
  - lib/coinjar/address.rb
100
100
  - lib/coinjar/client.rb
101
101
  - lib/coinjar/configuration.rb
102
+ - lib/coinjar/fair_rate.rb
102
103
  - lib/coinjar/payment.rb
103
104
  - lib/coinjar/transaction.rb
104
105
  - lib/coinjar/version.rb