reality-core 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 +4 -4
- data/lib/reality/base_element.rb +5 -1
- data/reality-core.gemspec +1 -1
- data/test/test_base_element.rb +4 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d0794a746e91197105fd806f254d38ed67218adf
|
4
|
+
data.tar.gz: 03243da0bd309c50eafac9aba9074af2508f01f7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5835ccad0bf2e31ca323fd539eb9624878e07070efe19097b86a60d78527007a18bdf8ceba5b335da06d1e66925cc1f55ea8240df39ceb7db37fdbda1a69e890
|
7
|
+
data.tar.gz: 706bf9a74edfa28f9abedbfb509f7ee9aa83430a2674366693921b30b104dbd4899d54b9535552ba4bbae18d936045d58fbbf9699c5736fa0b1a8b4e6919f4fe
|
data/lib/reality/base_element.rb
CHANGED
@@ -26,7 +26,11 @@ module Reality #nodoc
|
|
26
26
|
keys[0, keys.length - 1].each do |target_accessor_key|
|
27
27
|
target = target.send target_accessor_key.to_sym
|
28
28
|
end
|
29
|
-
|
29
|
+
begin
|
30
|
+
target.send "#{keys.last}=", v
|
31
|
+
rescue NoMethodError
|
32
|
+
raise "Attempted to configure property \"#{keys.last}\" on #{self.class} but property does not exist."
|
33
|
+
end
|
30
34
|
end
|
31
35
|
end
|
32
36
|
end
|
data/reality-core.gemspec
CHANGED
data/test/test_base_element.rb
CHANGED
@@ -7,6 +7,9 @@ class Reality::TestBaseElement < Reality::TestCase
|
|
7
7
|
attr_accessor :b
|
8
8
|
attr_accessor :c
|
9
9
|
|
10
|
+
def to_s
|
11
|
+
'TestElement'
|
12
|
+
end
|
10
13
|
end
|
11
14
|
|
12
15
|
def test_basic_operation
|
@@ -26,7 +29,7 @@ class Reality::TestBaseElement < Reality::TestCase
|
|
26
29
|
assert_equal '2', element2.b
|
27
30
|
assert_equal '3', element2.c
|
28
31
|
|
29
|
-
|
32
|
+
assert_raise_message("Attempted to configure property \"x\" on Reality::TestBaseElement::TestElement but property does not exist.") do
|
30
33
|
TestElement.new(:x => '1')
|
31
34
|
end
|
32
35
|
end
|