flow-reference 0.2.85
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 +7 -0
- data/.apidoc +7 -0
- data/.gitignore +3 -0
- data/Gemfile +6 -0
- data/Gemfile.lock +36 -0
- data/LICENSE +21 -0
- data/README.md +49 -0
- data/bin/build-currency.rb +46 -0
- data/bin/download.bash +7 -0
- data/bin/generate.bash +3 -0
- data/data/continents.json +259 -0
- data/data/countries.json +2675 -0
- data/data/currencies.json +862 -0
- data/data/languages.json +1318 -0
- data/data/locales.json +3182 -0
- data/data/payment-methods.json +280 -0
- data/data/regions.json +4880 -0
- data/flow-reference.gemspec +16 -0
- data/lib/flow-reference.rb +38 -0
- data/lib/generated/currencies.rb +832 -0
- data/lib/io_flow_reference_v0.rb +1104 -0
- data/spec/common/basic_spec.rb +30 -0
- data/spec/spec_helper.rb +7 -0
- metadata +71 -0
@@ -0,0 +1,30 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
RSpec.describe Flow::Reference::Currencies do
|
4
|
+
|
5
|
+
it 'checks loading of currency model' do
|
6
|
+
currency_class = ::Io::Flow::Reference::V0::Models::Currency
|
7
|
+
|
8
|
+
expect(Flow::Reference::Currencies.find('usd').class).to eq(currency_class)
|
9
|
+
expect(Flow::Reference::Currencies.find(' usd ').class).to eq(currency_class)
|
10
|
+
expect(Flow::Reference::Currencies.find('USD').class).to eq(currency_class)
|
11
|
+
expect(Flow::Reference::Currencies.find('JPY').class).to eq(currency_class)
|
12
|
+
|
13
|
+
expect(Flow::Reference::Currencies.find('other')).to be_nil
|
14
|
+
end
|
15
|
+
|
16
|
+
it 'checks to_cents conversion' do
|
17
|
+
expect(Flow::Reference::Currencies::Data.Usd.to_cents("10.52")).to eq(1052)
|
18
|
+
expect(Flow::Reference::Currencies::Data.Usd.to_cents("10.524")).to eq(1052)
|
19
|
+
expect(Flow::Reference::Currencies::Data.Usd.to_cents("10.525")).to eq(1053)
|
20
|
+
expect(Flow::Reference::Currencies::Data.Cad.to_cents("10.525")).to eq(1053)
|
21
|
+
expect(Flow::Reference::Currencies::Data.Usd.to_cents(100)).to eq(10000)
|
22
|
+
expect(Flow::Reference::Currencies::Data.Mro.to_cents("105")).to eq(1050)
|
23
|
+
expect(Flow::Reference::Currencies::Data.Mro.to_cents("105.55")).to eq(1056)
|
24
|
+
|
25
|
+
# Japan Jen has no cents
|
26
|
+
expect(Flow::Reference::Currencies::Data.Jpy.to_cents("105")).to eq(105)
|
27
|
+
expect(Flow::Reference::Currencies::Data.Jpy.to_cents(105)).to eq(105)
|
28
|
+
expect(Flow::Reference::Currencies.find('JPY').to_cents(105)).to eq(105)
|
29
|
+
end
|
30
|
+
end
|
data/spec/spec_helper.rb
ADDED
metadata
ADDED
@@ -0,0 +1,71 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: flow-reference
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.2.85
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Michael Bryzek
|
8
|
+
- Dino Reic
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain: []
|
12
|
+
date: 2017-03-31 00:00:00.000000000 Z
|
13
|
+
dependencies: []
|
14
|
+
description: Flow helper libraries for working with https://api.flow.io
|
15
|
+
email: mbryzek@alum.mit.edu
|
16
|
+
executables:
|
17
|
+
- build-currency.rb
|
18
|
+
- download.bash
|
19
|
+
- generate.bash
|
20
|
+
extensions: []
|
21
|
+
extra_rdoc_files: []
|
22
|
+
files:
|
23
|
+
- ".apidoc"
|
24
|
+
- ".gitignore"
|
25
|
+
- Gemfile
|
26
|
+
- Gemfile.lock
|
27
|
+
- LICENSE
|
28
|
+
- README.md
|
29
|
+
- bin/build-currency.rb
|
30
|
+
- bin/download.bash
|
31
|
+
- bin/generate.bash
|
32
|
+
- data/continents.json
|
33
|
+
- data/countries.json
|
34
|
+
- data/currencies.json
|
35
|
+
- data/languages.json
|
36
|
+
- data/locales.json
|
37
|
+
- data/payment-methods.json
|
38
|
+
- data/regions.json
|
39
|
+
- flow-reference.gemspec
|
40
|
+
- lib/flow-reference.rb
|
41
|
+
- lib/generated/currencies.rb
|
42
|
+
- lib/io_flow_reference_v0.rb
|
43
|
+
- spec/common/basic_spec.rb
|
44
|
+
- spec/spec_helper.rb
|
45
|
+
homepage: https://www.flow.io
|
46
|
+
licenses:
|
47
|
+
- MIT
|
48
|
+
metadata: {}
|
49
|
+
post_install_message:
|
50
|
+
rdoc_options: []
|
51
|
+
require_paths:
|
52
|
+
- lib
|
53
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
54
|
+
requirements:
|
55
|
+
- - ">="
|
56
|
+
- !ruby/object:Gem::Version
|
57
|
+
version: '0'
|
58
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
59
|
+
requirements:
|
60
|
+
- - ">="
|
61
|
+
- !ruby/object:Gem::Version
|
62
|
+
version: '0'
|
63
|
+
requirements: []
|
64
|
+
rubyforge_project:
|
65
|
+
rubygems_version: 2.6.10
|
66
|
+
signing_key:
|
67
|
+
specification_version: 4
|
68
|
+
summary: Flow helpers
|
69
|
+
test_files:
|
70
|
+
- spec/common/basic_spec.rb
|
71
|
+
- spec/spec_helper.rb
|