openexchangerates 0.0.1 → 0.1.0
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 +4 -4
- data/README.md +11 -3
- data/example.rb +5 -3
- data/lib/openexchangerates.rb +1 -0
- data/openexchangerates.gemspec +2 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cf4cfe33f88cb15f7aac7664538030eb1e641583
|
4
|
+
data.tar.gz: b351fc413bb57cb5133e9e776c4e7812906fb64f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8342df7e4a1b05524709f4e999b1e8d4bc241638551fc62063450a32cf5f2d3354085b5f0bf5b5263ba7e005af554498b0f51b993d0da2e627bcc1ac24e4315c
|
7
|
+
data.tar.gz: dfe39dce443625f2e1bd9463c4b835b025363aaeeec064b6c4cb94b0e5a30d496e793155a52b4605f92ff87edf5ef1af9a379bd745e669abfcc68e6ec0bd1843
|
data/README.md
CHANGED
@@ -1,4 +1,12 @@
|
|
1
|
-
openexchangerates
|
2
|
-
=================
|
3
|
-
|
1
|
+
### openexchangerates ###
|
4
2
|
Implementation API openexchangerates.org on Ruby
|
3
|
+
|
4
|
+
### methods ###
|
5
|
+
**1.** `get_latest()`
|
6
|
+
Get the most recent exchange rates
|
7
|
+
|
8
|
+
**2.** `get_currencies`
|
9
|
+
get list of currency codes and names
|
10
|
+
|
11
|
+
**3.** `get_old(date)`
|
12
|
+
get rates for any given day, where available
|
data/example.rb
CHANGED
@@ -4,9 +4,11 @@ require 'openexchangerates'
|
|
4
4
|
|
5
5
|
currency = OpenExchange.new('586ee899f7eb4f79861589a1f00a8630')
|
6
6
|
cur = JSON.parse(currency.get_latest)
|
7
|
+
cur_old = JSON.parse(currency.get_old('2010-12-31'))
|
7
8
|
|
8
9
|
cur_show = 'RUB'
|
9
10
|
|
10
|
-
puts "
|
11
|
-
|
12
|
-
|
11
|
+
puts "#{Time.at(cur_old['timestamp'])} \n\t1 USD = #{cur['rates'][cur_show]} \
|
12
|
+
#{JSON.parse(currency.get_currencies)[cur_show]}"
|
13
|
+
puts "#{Time.at(cur['timestamp'])} \n\t1 USD = #{cur_old['rates'][cur_show]} \
|
14
|
+
#{JSON.parse(currency.get_currencies)[cur_show]}"
|
data/lib/openexchangerates.rb
CHANGED
data/openexchangerates.gemspec
CHANGED
@@ -1,9 +1,9 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
s.name = 'openexchangerates'
|
3
|
-
s.version = '0.0
|
3
|
+
s.version = '0.1.0'
|
4
4
|
s.date = '2012-12-06'
|
5
5
|
s.summary = 'Implementation API openexchangerates.org on Ruby'
|
6
|
-
s.description = '
|
6
|
+
s.description = '...'
|
7
7
|
s.authors = ['Alexander Popov']
|
8
8
|
s.email = ['iiiypuk@iiiypuk.me']
|
9
9
|
s.homepage = 'https://github.com/IIIypuk/openexchangerates'
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: openexchangerates
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
4
|
+
version: 0.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alexander Popov
|
@@ -10,7 +10,7 @@ bindir: bin
|
|
10
10
|
cert_chain: []
|
11
11
|
date: 2012-12-06 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
|
-
description:
|
13
|
+
description: '...'
|
14
14
|
email:
|
15
15
|
- iiiypuk@iiiypuk.me
|
16
16
|
executables: []
|