oexrwrapper 0.1.2 → 0.1.3

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: 8ec77047eb93bf59231cc3902f544a67da3d232ef2aaf5e190a230112091ea04
4
- data.tar.gz: b42584b458a8a55fb3e4c68c39ae18fb2ddc786b95ab71f733371fd2281705d8
3
+ metadata.gz: a706334a795ad7d94d7fbe59423811794cdf966a92630dd3f11fae69db2b8eb8
4
+ data.tar.gz: 5ffb6ea6bedfb17ded3dc517c4f9ac4238d9a19d23cc1d4b035542210230358f
5
5
  SHA512:
6
- metadata.gz: 63346ab370c482faafbfd5f7e07c3a67dd6832e0f8e1fcc4c87a5340658b4d72b4482b0b3dae0dc1612ab778f3139f17fddd4821a1374ef925f3ac8d67695287
7
- data.tar.gz: f5aa0b5b820a867d105226973fa11172b36913f525ab90b40e8ba8e0290238a8ea2b9e1caa79ad77453a928caaadeb7a7aaf7e8f7ea618503f51488c2309d25b
6
+ metadata.gz: ff20781ab6ada74c7e4baaffb1f6c91e87cd9cd6fa100a69a020cd20a038891f0dcbd59cceeedfa980d5acc65b44def461867f0f13684406397a3625d41a60ae
7
+ data.tar.gz: 15adf92eee3fb001809f3d45cda3f19df16f0b6f28817f767c3e0e194c315e74179dd3e33446d322e297273c1e4da7845429b40967ad6263fb06d838bb485c51
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- oexrwrapper (0.1.2)
4
+ oexrwrapper (0.1.3)
5
5
  faraday (~> 2.2)
6
6
 
7
7
  GEM
data/README.md CHANGED
@@ -1,6 +1,7 @@
1
1
  # OEXRWrapper
2
2
  [![Maintainability](https://api.codeclimate.com/v1/badges/a71a2a3a3e3ce266b7c0/maintainability)](https://codeclimate.com/github/sdglhm/OEXRWrapper/maintainability)
3
- ![example workflow](https://github.com/sdglhm/OEXRWrapper/actions/workflows/build.yml/badge.svg)
3
+ ![example workflow](https://github.com/sdglhm/OEXRWrapper/actions/workflows/build.yml/badge.svg)
4
+ [![Gem Version](https://badge.fury.io/rb/oexrwrapper.svg)](https://badge.fury.io/rb/oexrwrapper)
4
5
  Simple gem written for learning purposes. Fetches latest exchange rate from OpenExchangeRates.org and returns value.
5
6
 
6
7
  ## ToDo
@@ -1,4 +1,4 @@
1
1
  module OEXRWrapper
2
- class Currencies < Object
2
+ class Currencies < SimpleDelegator
3
3
  end
4
4
  end
@@ -0,0 +1,10 @@
1
+ module OEXRWrapper
2
+ class Currency
3
+ attr_accessor :name, :code
4
+
5
+ def initialize(code, name)
6
+ @code = code
7
+ @name = name
8
+ end
9
+ end
10
+ end
@@ -1,7 +1,12 @@
1
1
  module OEXRWrapper
2
2
  class CurrenciesResources < Resource
3
3
  def retrieve
4
- Currencies.new get_request('currencies').body
4
+ currency_array = Array.new
5
+ get_request('currencies').body.each do |currency|
6
+ currency_array.push(Currency.new(currency[0], currency[1]))
7
+ end
8
+
9
+ Currencies.new currency_array
5
10
  end
6
11
 
7
12
  def code_to_string(code)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module OEXRWrapper
4
- VERSION = "0.1.2"
4
+ VERSION = "0.1.3"
5
5
  end
data/lib/oexrwrapper.rb CHANGED
@@ -16,4 +16,5 @@ module OEXRWrapper
16
16
  # Classes
17
17
  autoload :Latest, "oexrwrapper/objects/latest"
18
18
  autoload :Currencies, "oexrwrapper/objects/currencies"
19
+ autoload :Currency, "oexrwrapper/objects/currency"
19
20
  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.2
4
+ version: 0.1.3
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-25 00:00:00.000000000 Z
11
+ date: 2022-03-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -45,6 +45,7 @@ files:
45
45
  - lib/oexrwrapper/error.rb
46
46
  - lib/oexrwrapper/object.rb
47
47
  - lib/oexrwrapper/objects/currencies.rb
48
+ - lib/oexrwrapper/objects/currency.rb
48
49
  - lib/oexrwrapper/objects/latest.rb
49
50
  - lib/oexrwrapper/resource.rb
50
51
  - lib/oexrwrapper/resources/currencies.rb