smart_properties 1.8.1 → 1.9.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: 01dcc093f88456b5adc03fda8756ce4c82fadf2d
4
- data.tar.gz: 02e619aa94f6b2a1106e787f5f4ccfe4745f5b4d
3
+ metadata.gz: 9129f5a59082dea813606c2c71007a999765dec0
4
+ data.tar.gz: 580c42e4b0d7cc3c728a44374b2bbdbbd683b4cf
5
5
  SHA512:
6
- metadata.gz: ba7245f78b5720fe02adbf55f89a87f4a92c6525813fde45160c647f6506a76de3127606c0835c58584562a74ed05e2e106a69590372049983f89168a75014bd
7
- data.tar.gz: 7b2ec9c3656e8d361e370118c9ef7f964770541a5ad84b725136796516179d25ddb225ea1fccb643fbe8fbe1408b0a429fdc97fb9227bb1bf15071e77c605c95
6
+ metadata.gz: 22e0491c55f9f6aa08621bc2501f66e093aa005412ae647768907d4dcae2b9c730fcf542a3ef5ac8ff30bdb8ef83f7ad62e406d7b4eb72cee449ee65ada9c3ad
7
+ data.tar.gz: 0706e812564f577b0da0dd2fd1fcea21aaea5e19321832be0151fb9b21c1bf9ea9c14774b549e1a59ce9e7d3de4defe46e3ffa58835201a694624a0fc6c44c65
@@ -21,7 +21,7 @@
21
21
  # :required => true
22
22
  #
23
23
  module SmartProperties
24
- VERSION = "1.8.1"
24
+ VERSION = "1.9.0"
25
25
 
26
26
  class Error < ::ArgumentError; end
27
27
  class ConfigurationError < Error; end
@@ -202,6 +202,14 @@ module SmartProperties
202
202
  collection_with_parent_collection.key?(name)
203
203
  end
204
204
 
205
+ def keys
206
+ collection_with_parent_collection.keys
207
+ end
208
+
209
+ def values
210
+ collection_with_parent_collection.values
211
+ end
212
+
205
213
  def each(&block)
206
214
  collection_with_parent_collection.each(&block)
207
215
  end
@@ -33,6 +33,16 @@ RSpec.describe SmartProperties, 'intheritance' do
33
33
  context 'the section class' do
34
34
  it('should respond to #properties') { expect(section).to respond_to(:properties) }
35
35
 
36
+ it "should expose the names of the properties through its property collection" do
37
+ expect(section.properties.keys).to eq([:title])
38
+ end
39
+
40
+ it "should expose the the properties through its property collection" do
41
+ properties = subsection.properties.values
42
+ expect(properties.first).to be_kind_of(SmartProperties::Property)
43
+ expect(properties.first.name).to eq(:title)
44
+ end
45
+
36
46
  context 'an instance of this class' do
37
47
  subject { section.new }
38
48
  it { is_expected.to have_smart_property(:title) }
@@ -48,6 +58,19 @@ RSpec.describe SmartProperties, 'intheritance' do
48
58
  context 'the subsectionclass' do
49
59
  it('should respond to #properties') { expect(subsection).to respond_to(:properties) }
50
60
 
61
+ it "should expose the names of the properties through its property collection" do
62
+ expect(subsection.properties.keys).to eq([:title, :subtitle])
63
+ end
64
+
65
+ it "should expose the the properties through its property collection" do
66
+ properties = subsection.properties.values
67
+ expect(properties.first).to be_kind_of(SmartProperties::Property)
68
+ expect(properties.first.name).to eq(:title)
69
+
70
+ expect(properties.last).to be_kind_of(SmartProperties::Property)
71
+ expect(properties.last.name).to eq(:subtitle)
72
+ end
73
+
51
74
  context 'an instance of this class' do
52
75
  subject(:instance) { subsection.new }
53
76
  it { is_expected.to have_smart_property(:title) }
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: smart_properties
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.8.1
4
+ version: 1.9.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Konstantin Tennhard
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-09-22 00:00:00.000000000 Z
11
+ date: 2015-09-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec