fixer-rb 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: 1f71d6fcdbe0db8212b251cc4e2bae06f155999f
4
- data.tar.gz: 325efc74ed133115b6335e1c1b1e040e0f191352
3
+ metadata.gz: 6e827f1480943b3021ebdefcc8858f475193193b
4
+ data.tar.gz: cd10edf021724191102931fdd7eaf25c1f9d90a1
5
5
  SHA512:
6
- metadata.gz: 990d428765fecf8dba42e9532593afc4bd3d47b25c06f302d1431288bb958e7d701c56eab155105c6c780603d3ecaa869d56070167cce0c6eb67dc1b95178c8a
7
- data.tar.gz: a0f611cd42928b3feb9213598c163b0cbb6418e3822cf76e1930abbc88ee10c15b195deb2e5692b521dc7bf00c8cda19a7d73dd9390fa78fc83af5ffd01d1a40
6
+ metadata.gz: cd02f8e6fb8c66a9f8db1ab8913de42abf0ec07cf87b4243b583d2564dde8a8637ff67af5108bc72f6da5561878c088fc646589174e75b0d3bf254a12e81603a
7
+ data.tar.gz: 933a9486b24174674a0fd2f4243e326467c1b528c5d4b042853a1f15d8612a82e54f0514d46df057401039dec5919ad15e54fdd8361fe388551ab3278b0e09b5
data/README.md CHANGED
@@ -20,13 +20,16 @@ require 'fixer'
20
20
  fixer = Fixer::Request.new 'CNY'
21
21
  params = {target: 'USD', ammount: 1000}
22
22
 
23
- fixer.transfer(params)
23
+ fixer.transfer(params) # 149.75
24
24
  $ 149.75
25
25
  ```
26
26
 
27
+ Get currency rate
27
28
  ```
28
29
  fixer.get_rate do |rate|
29
- rate.USD
30
+ usd = rate.USD # 0.14975
31
+ rate_in_hash = rate.to_h
32
+ rate_in_json = rate.to_json
30
33
  end
31
34
 
32
35
  $ 0.14975
@@ -0,0 +1,9 @@
1
+ module Extensions
2
+ module OpenStruct
3
+ module Format
4
+ def to_json
5
+ table.to_json
6
+ end
7
+ end
8
+ end
9
+ end
@@ -4,6 +4,9 @@ require 'httparty'
4
4
 
5
5
  require "fixer/version"
6
6
  require "fixer/request"
7
+ require "./lib/extensions/open_struct/format"
8
+
9
+ OpenStruct.include Extensions::OpenStruct::Format
7
10
 
8
11
  module Fixer
9
12
  class << self
@@ -1,3 +1,3 @@
1
1
  module Fixer
2
- VERSION = "0.1.2"
2
+ VERSION = "0.1.3"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fixer-rb
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
  - Taff Gao
@@ -83,6 +83,7 @@ files:
83
83
  - bin/console
84
84
  - bin/setup
85
85
  - fixer.gemspec
86
+ - lib/extensions/open_struct/format.rb
86
87
  - lib/fixer.rb
87
88
  - lib/fixer/request.rb
88
89
  - lib/fixer/version.rb