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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 05dc3742677d8f04ac81872eb5cd29c3026691086ee2618d23e9f903aee5e3d8
4
- data.tar.gz: 4e52196789c76613421cd313469c958add769d761a5f737f9dd1f443aff36a93
3
+ metadata.gz: 642ff556943c7cbcf1a36dad9f1059009b73973934ac4f1aa7feedd3020b0a32
4
+ data.tar.gz: f976859603a88303c31cd0d7ba88ba468cfb9787b64aeecd82be1621fabae76f
5
5
  SHA512:
6
- metadata.gz: 7f3a0d9a033cf528bb82d0ee344dbac3caff46a0388b533a32f46694261dfa5f25e5a1e0d24661e4f721425271c344bff479c73adc710cee308b1740f08acf7e
7
- data.tar.gz: 9073282c2852c27ff7981e26494b281efb5d1f80fd402358f1a7b72a3bfb73bfce0b9dec6214316501a442c3fb8693dec2bb3f45ceb29d3aaa8928818c55caa3
6
+ metadata.gz: bc671989bfbd958736b1282344c7e3e59394a89e04b69de5d2815c47bf5de74e7b7b6d5468b79bc448ed4a6d40f862babcb6a31ca2b93bb0359bb039b9e58b05
7
+ data.tar.gz: fb4f319603d9941ab0ec8d0b4e40fde01e22dd8f813f4ff06b5ac07d41e385f52e6caeb32a1a163aaf5795d6d8f8cea5eeefb95adce4dbc2af3a14500cc333b3
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- oexrwrapper (0.1.0)
4
+ oexrwrapper (0.1.1)
5
5
  faraday (~> 2.2)
6
6
 
7
7
  GEM
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
- - [ ] Implement currencies list
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/[USERNAME]/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/[USERNAME]/oexrwrapper/blob/master/CODE_OF_CONDUCT.md).
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
 
@@ -13,7 +13,11 @@ module OEXRWrapper
13
13
  end
14
14
 
15
15
  def latest
16
- LatestResource.new(self)
16
+ LatestResource.new self
17
+ end
18
+
19
+ def currencies
20
+ CurrenciesResources.new self
17
21
  end
18
22
 
19
23
  def connection
@@ -0,0 +1,4 @@
1
+ module OEXRWrapper
2
+ class Currencies < Object
3
+ end
4
+ end
@@ -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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module OEXRWrapper
4
- VERSION = "0.1.0"
4
+ VERSION = "0.1.1"
5
5
  end
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.0
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-21 00:00:00.000000000 Z
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