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.
Files changed (3) hide show
  1. data/lib/acdc/element.rb +2 -2
  2. data/lib/acdc.rb +1 -1
  3. 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.is_a?(Element) ? value.acdc : value.to_s
60
+ value.respond_to?(:acdc) ? value.acdc : value.to_s
61
61
  end
62
62
  end
63
63
 
data/lib/acdc.rb CHANGED
@@ -9,7 +9,7 @@ require File.join(File.dirname(__FILE__),"acdc","body")
9
9
 
10
10
  module AcDc
11
11
 
12
- VERSION = [0,1,5] unless defined?(AcDc::VERSION)
12
+ VERSION = [0,2,0] unless defined?(AcDc::VERSION)
13
13
 
14
14
  if defined?(JAIL_BREAK)
15
15
  Element.class_eval{ alias :to_s :acdc }
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: clinth3o-acdc
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.5
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Clint Hill