acdc 0.2.3 → 0.2.5
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.
- data/lib/acdc.rb +1 -1
- data/lib/acdc/body.rb +4 -7
- metadata +1 -1
data/lib/acdc.rb
CHANGED
data/lib/acdc/body.rb
CHANGED
@@ -37,7 +37,9 @@ module AcDc
|
|
37
37
|
if type and type.ancestors.include?(Body)
|
38
38
|
elements.update(key => type.new(val.to_hash.merge(:sequence => options_for(key)[:sequence])))
|
39
39
|
elsif type
|
40
|
-
|
40
|
+
# if it's an Element we want the value (avoids recursive value)
|
41
|
+
value = (val.respond_to?(:value)) ? val.value : val
|
42
|
+
elements.update(key => type.new(value, options_for(key)))
|
41
43
|
else
|
42
44
|
elements.update(key => Element(val, options_for(key)))
|
43
45
|
end
|
@@ -177,12 +179,7 @@ module AcDc
|
|
177
179
|
|
178
180
|
def read(method_id)
|
179
181
|
if elements.has_key?(method_id)
|
180
|
-
|
181
|
-
if obj.is_a?(Body)
|
182
|
-
elements[method_id]
|
183
|
-
else
|
184
|
-
elements[method_id].value
|
185
|
-
end
|
182
|
+
elements[method_id]
|
186
183
|
else
|
187
184
|
attributes[method_id].value
|
188
185
|
end
|