abokifx_indexer 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: 98ed90f466b637605fef140669188ed4174682d9
4
- data.tar.gz: 2a30361e35e0defffa01d5c3abf9edc130d03e0d
3
+ metadata.gz: b01cbab8906f87f6d174cba23effa7d01b687b19
4
+ data.tar.gz: 02c246bcb4ce2c48fb7be486ec18b015d0ef9c58
5
5
  SHA512:
6
- metadata.gz: 78d74f372764ba302f6f6a68f6a1ce4bf519f52e09d19d0ea9b9e951feda2e0e5a62ac8352acdb687b04bb976ebc8bfd3fa20fbdffa714e86bb707e8b954ea23
7
- data.tar.gz: 3f451e5ab65c2e61eba74d07696886b33401f59193054e3dd41b449f3b8cef050aff6e62b3dee48d4daa643b50b4be07647581efe38da5b2dbe2b7e6e0299387
6
+ metadata.gz: 8540212780369f756d0a769900bb1ac49d93bf8bd61ed52b165232436045346dc2d1bc3c551e4f7ac9ca4a7e4524c20b03872bc7f1aebc7fdc7e8dee49e747ff
7
+ data.tar.gz: 5a9481dd864548296a6a8432222451aab30f414b4697515813c5185630217cd18de38bc959225693f7792f5246fae8156c046a029ff4e85bb482b0404a0b0309
@@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file.
4
4
  The format is based on [Keep a Changelog](http://keepachangelog.com/)
5
5
  and this project adheres to [Semantic Versioning](http://semver.org/).
6
6
 
7
+ ## [0.1.3] - 2017-05-03
8
+ ### Changed
9
+ - Fix returned rates based on counter_currency values
10
+
7
11
  ## [0.1.2] - 2017-05-03
8
12
  ### Changed
9
13
  - Update `nokogiri` dependency
@@ -3,8 +3,8 @@ module AbokiFXIndexer
3
3
 
4
4
  attribute :base_currency, String
5
5
  attribute :counter_currency, String
6
- attribute :buy_rate, Float
7
- attribute :sell_rate, Float
6
+ attribute :buy_rate, BigDecimal
7
+ attribute :sell_rate, BigDecimal
8
8
  attribute :post_date, Date
9
9
  attribute :fetched_at, DateTime, default: DateTime.now
10
10
 
@@ -13,8 +13,8 @@ module AbokiFXIndexer
13
13
  CurrencyPair.new(
14
14
  base_currency: "NGN",
15
15
  counter_currency: currency,
16
- buy_rate: buy_sell_rate[:buy_rate],
17
- sell_rate: buy_sell_rate[:sell_rate],
16
+ buy_rate: 1.0 / buy_sell_rate[:buy_rate],
17
+ sell_rate: 1.0 / buy_sell_rate[:sell_rate],
18
18
  post_date: Date.strptime(post_date, "%d/%m/%Y"),
19
19
  )
20
20
  end
@@ -31,7 +31,10 @@ module AbokiFXIndexer
31
31
  when "EUR"
32
32
  latest_row.search("td")[3].text
33
33
  end
34
- { buy_rate: rates.split("/")[0].to_f, sell_rate: rates.split("/")[1].to_f }
34
+ {
35
+ buy_rate: BigDecimal.new(rates.split("/")[0]),
36
+ sell_rate: BigDecimal.new(rates.split("/")[1]),
37
+ }
35
38
  end
36
39
 
37
40
  def base_target_css_classes
@@ -1,3 +1,3 @@
1
1
  module AbokiFXIndexer
2
- VERSION = "0.1.2"
2
+ VERSION = "0.1.3"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: abokifx_indexer
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
  - Ace Subido
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-05-03 00:00:00.000000000 Z
11
+ date: 2017-05-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport