latinum 1.0.0 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 16215481d04c41e76fa7bda13e0977acbf0a3862
4
- data.tar.gz: a192fa7dd018680858f4770e44c318cbf6b9be1c
3
+ metadata.gz: 1d25caed111068113305cf5449f8827c264b0cae
4
+ data.tar.gz: 173082ed719b3c01d3f8ca0695015f43e5d73f9b
5
5
  SHA512:
6
- metadata.gz: b8d753a9318134a4347ab131f549b1bad9aa5970c805b0458b6357f56002b47241679c9d8194f3a41223a2e0be41112742f293162c970ae40cf76b4249ab1e10
7
- data.tar.gz: 6c1f2c3137edbb552730b052077aa462a39e8749ef50c6d7f033c7acc536d1f20132b4d09511993f2aac035cf50ea2911a154f4e6e66220c6fbcefbcfe5ff3b6
6
+ metadata.gz: 3c471f206c325bee3ebb24bb6d5a25cdf97962c9061e28c02befe5ba223dd7a6b0a46635590ed3b033622bfd4a989f61061734b3c4571fbca9ea3ee002e5e5d3
7
+ data.tar.gz: 919248b516aa585221b428cbc462127d3e0fd94074359ccd12e74c2f3b65030ad8f32b683dd68fef8f2443b3f3d4d8fbab382191ed386949c41c519acf13787a
@@ -64,5 +64,13 @@ module Latinum
64
64
  def []= key, amount
65
65
  @resources[key] = amount
66
66
  end
67
+
68
+ def each
69
+ return to_enum(:each) unless block_given?
70
+
71
+ @resources.each do |key, value|
72
+ yield Resource.new(value, key)
73
+ end
74
+ end
67
75
  end
68
76
  end
@@ -19,5 +19,5 @@
19
19
  # THE SOFTWARE.
20
20
 
21
21
  module Latinum
22
- VERSION = "1.0.0"
22
+ VERSION = "1.1.0"
23
23
  end
@@ -81,5 +81,18 @@ module Latinum::CollectionSpec
81
81
  expect(subject["AUD"]).to be == Latinum::Resource.load("20 AUD")
82
82
  expect(subject["USD"]).to be == Latinum::Resource.load("20 USD")
83
83
  end
84
+
85
+ it "can enumerate resources" do
86
+ resources = [
87
+ Latinum::Resource.new("10", "NZD"),
88
+ Latinum::Resource.new("10", "AUD"),
89
+ Latinum::Resource.new("10", "USD"),
90
+ ]
91
+
92
+ collection = Latinum::Collection.new
93
+ collection << resources
94
+
95
+ expect(collection.each.to_a).to be == resources
96
+ end
84
97
  end
85
98
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: latinum
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Samuel Williams
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-03-12 00:00:00.000000000 Z
11
+ date: 2017-02-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -99,7 +99,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
99
99
  version: '0'
100
100
  requirements: []
101
101
  rubyforge_project:
102
- rubygems_version: 2.5.2
102
+ rubygems_version: 2.6.10
103
103
  signing_key:
104
104
  specification_version: 4
105
105
  summary: Latinum is a simple gem for managing resource computations, including money