cnb 0.1.2 → 0.1.4

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
  SHA1:
3
- metadata.gz: 1b1981ee623b1b196bac0e1fa96e15c1278d1197
4
- data.tar.gz: 8ea6a41b478a5d94feb0fb0a8d832a01e1cd8d12
3
+ metadata.gz: d8bebe99129e461c1bceb59a2a43f1754221488e
4
+ data.tar.gz: 31d620b7020a35a9a82d692d51d7daa085864565
5
5
  SHA512:
6
- metadata.gz: 4ebd88e00c2b4d9ae38f9d552adffe22f711365f090d5cdd0f3b9558af2335fcf0cef9d84f308acf22a117f0573e189110f1ff31e2af8f89b0fb6790ea26358d
7
- data.tar.gz: 8740aaad851c8f7dc669e16d6520e0f1213b09e5d4aceff1d907c89469e506044f4913e3b99ad5aab6e36cf7806e0024e10d879b29fec7cc20e67b2c5980e5d1
6
+ metadata.gz: f7751cf538513923175f62e5321b306ea0d773dfdc9471be30e205e387c888e47212eb6e7196ec0e4ab53bda0359fc2a52928905a81b731da56b62d54e48e8b1
7
+ data.tar.gz: f2a93574bb6034564afd3af9b657f39c888f0143b28471ba35f98f3f9a12aca08893ae45c69b6828100a6f2ebdae81f6099372a8f2849f330a6d9f979bcbf6f9
data/lib/cnb.rb CHANGED
@@ -1,21 +1,17 @@
1
- require_relative 'cnb/currency_rates'
2
- require_relative 'cnb/daily_rates'
3
- require_relative 'cnb/monthly_rates'
1
+ require 'cnb/currency_rates'
2
+ require 'cnb/daily_rates'
3
+ require 'cnb/monthly_rates'
4
4
 
5
5
  module CNB
6
6
  PRIMARY_CURRENCY = 'CZK'
7
7
 
8
- @rates_objects = {}
9
-
10
8
  class << self
11
9
  def daily_rates
12
- key = :daily
13
- @rates_objects[key] ||= DailyRates.new
10
+ DailyRates.new
14
11
  end
15
12
 
16
13
  def monthly_rates(month, year)
17
- key = "#{month}-#{year}"
18
- @rates_objects[key] ||= MonthlyRates.new(month, year)
14
+ MonthlyRates.new(month, year)
19
15
  end
20
16
  end
21
17
  end
data/lib/cnb/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module CNB
2
- VERSION = '0.1.2'
2
+ VERSION = '0.1.4'
3
3
  end
data/spec/cnb_spec.rb CHANGED
@@ -9,11 +9,6 @@ describe 'CNB' do
9
9
  it 'returns DailyRates object' do
10
10
  expect(CNB.daily_rates).to be_a(CNB::DailyRates)
11
11
  end
12
-
13
- it 'always returns the same object' do
14
- rates = CNB.daily_rates
15
- expect(CNB.daily_rates.object_id).to eq rates.object_id
16
- end
17
12
  end
18
13
 
19
14
  describe '#monthly_rates' do
@@ -24,11 +19,5 @@ describe 'CNB' do
24
19
  it 'returns MonthlyRates object' do
25
20
  expect(CNB.monthly_rates(11,2013)).to be_a(CNB::MonthlyRates)
26
21
  end
27
-
28
- it 'always returns the same object for the same combination of month and year params' do
29
- rates = CNB.monthly_rates(11, 2013)
30
- expect(CNB.monthly_rates(11, 2013).object_id).to eq rates.object_id
31
- expect(CNB.monthly_rates(10, 2013).object_id).not_to eq rates.object_id
32
- end
33
22
  end
34
23
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cnb
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jan Zikán