oexrwrapper 0.1.0 → 0.1.1
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/Gemfile.lock +1 -1
- data/README.md +9 -2
- data/lib/oexrwrapper/client.rb +5 -1
- data/lib/oexrwrapper/objects/currencies.rb +4 -0
- data/lib/oexrwrapper/resources/currencies.rb +13 -0
- data/lib/oexrwrapper/version.rb +1 -1
- data/lib/oexrwrapper.rb +2 -0
- metadata +4 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 642ff556943c7cbcf1a36dad9f1059009b73973934ac4f1aa7feedd3020b0a32
|
|
4
|
+
data.tar.gz: f976859603a88303c31cd0d7ba88ba468cfb9787b64aeecd82be1621fabae76f
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: bc671989bfbd958736b1282344c7e3e59394a89e04b69de5d2815c47bf5de74e7b7b6d5468b79bc448ed4a6d40f862babcb6a31ca2b93bb0359bb039b9e58b05
|
|
7
|
+
data.tar.gz: fb4f319603d9941ab0ec8d0b4e40fde01e22dd8f813f4ff06b5ac07d41e385f52e6caeb32a1a163aaf5795d6d8f8cea5eeefb95adce4dbc2af3a14500cc333b3
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
|
@@ -4,7 +4,7 @@ Simple gem written for learning purposes. Fetches latest exchange rate from Open
|
|
|
4
4
|
|
|
5
5
|
## ToDo
|
|
6
6
|
- [X] Get latest currency exchange rate
|
|
7
|
-
- [
|
|
7
|
+
- [X] Implement currencies list
|
|
8
8
|
- [ ] Write tests (Probably)
|
|
9
9
|
|
|
10
10
|
## Installation
|
|
@@ -34,6 +34,13 @@ client.latest.retrieve
|
|
|
34
34
|
# Get a single currency exchange rate from code
|
|
35
35
|
client.latest.usd
|
|
36
36
|
client.latest.jpy
|
|
37
|
+
|
|
38
|
+
# Get list of supported currencies
|
|
39
|
+
client.currencies.retrieve
|
|
40
|
+
|
|
41
|
+
# Convert a three letter currency code to currency name
|
|
42
|
+
client.currencies.code_to_string('usd')
|
|
43
|
+
client.currencies.code_to_s('usd')
|
|
37
44
|
```
|
|
38
45
|
## Development
|
|
39
46
|
|
|
@@ -43,7 +50,7 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
|
|
|
43
50
|
|
|
44
51
|
## Contributing
|
|
45
52
|
|
|
46
|
-
Bug reports and pull requests are welcome on GitHub at https://github.com/
|
|
53
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/sdglhm/OEXRWrapper. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/sdglhm/OEXRWrapper/blob/master/CODE_OF_CONDUCT.md).
|
|
47
54
|
|
|
48
55
|
## Code of Conduct
|
|
49
56
|
|
data/lib/oexrwrapper/client.rb
CHANGED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
module OEXRWrapper
|
|
2
|
+
class CurrenciesResources < Resource
|
|
3
|
+
def retrieve
|
|
4
|
+
Currencies.new get_request('currencies').body
|
|
5
|
+
end
|
|
6
|
+
|
|
7
|
+
def code_to_string(code)
|
|
8
|
+
get_request('currencies').body[String(code).upcase]
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
alias code_to_s code_to_string
|
|
12
|
+
end
|
|
13
|
+
end
|
data/lib/oexrwrapper/version.rb
CHANGED
data/lib/oexrwrapper.rb
CHANGED
|
@@ -11,7 +11,9 @@ module OEXRWrapper
|
|
|
11
11
|
|
|
12
12
|
# Resources
|
|
13
13
|
autoload :LatestResource, "oexrwrapper/resources/latest"
|
|
14
|
+
autoload :CurrenciesResources, "oexrwrapper/resources/currencies"
|
|
14
15
|
|
|
15
16
|
# Classes
|
|
16
17
|
autoload :Latest, "oexrwrapper/objects/latest"
|
|
18
|
+
autoload :Currencies, "oexrwrapper/objects/currencies"
|
|
17
19
|
end
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: oexrwrapper
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Lahiru Himesh Madusanka
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2022-03-
|
|
11
|
+
date: 2022-03-25 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: faraday
|
|
@@ -44,8 +44,10 @@ files:
|
|
|
44
44
|
- lib/oexrwrapper/client.rb
|
|
45
45
|
- lib/oexrwrapper/error.rb
|
|
46
46
|
- lib/oexrwrapper/object.rb
|
|
47
|
+
- lib/oexrwrapper/objects/currencies.rb
|
|
47
48
|
- lib/oexrwrapper/objects/latest.rb
|
|
48
49
|
- lib/oexrwrapper/resource.rb
|
|
50
|
+
- lib/oexrwrapper/resources/currencies.rb
|
|
49
51
|
- lib/oexrwrapper/resources/latest.rb
|
|
50
52
|
- lib/oexrwrapper/version.rb
|
|
51
53
|
- sig/oexrwrapper.rbs
|