clinth3o-acdc 0.1.5 → 0.2.0
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/element.rb +2 -2
- data/lib/acdc.rb +1 -1
- metadata +1 -1
data/lib/acdc/element.rb
CHANGED
@@ -9,7 +9,7 @@ module AcDc
|
|
9
9
|
#@param [Object] value Any value to place in the tags
|
10
10
|
#@option options [Boolean] :single False if object is a collection
|
11
11
|
#@option options [String] :tag A tag name to use if not Element
|
12
|
-
def initialize(value, options={})
|
12
|
+
def initialize(value=nil, options={})
|
13
13
|
@tag = options[:tag] ||= self.class.to_s.split("::").last
|
14
14
|
@value = value
|
15
15
|
@options = options
|
@@ -57,7 +57,7 @@ module AcDc
|
|
57
57
|
if has_many?
|
58
58
|
value.inject(""){|xml,val| xml << (val.is_a?(Element) ? val.acdc : val.to_s)}
|
59
59
|
else
|
60
|
-
value.
|
60
|
+
value.respond_to?(:acdc) ? value.acdc : value.to_s
|
61
61
|
end
|
62
62
|
end
|
63
63
|
|
data/lib/acdc.rb
CHANGED