Module: XMLObject

Defined in:
lib/xml-object/adapters.rb,
lib/xml-object.rb,
lib/xml-object/version.rb

Overview

:nodoc:

Defined Under Namespace

Modules: Adapters, Element, Properties Classes: CollectionProxy

Constant Summary collapse

VERSION =
'1.0.0'
LOCATION =

:nodoc:

File.dirname __FILE__

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.adapterObject

:nodoc:



3
4
5
# File 'lib/xml-object/adapters.rb', line 3

def adapter
  @adapter
end

Class Method Details

.new(duck) ⇒ Object

Returns a String or Array object representing the given XML, decorated with methods to access attributes and/or child elements.



11
12
13
14
15
16
17
# File 'lib/xml-object.rb', line 11

def self.new(duck) # :nodoc:
	case duck
		when @adapter::Element then new_decorated_obj duck
		when Array             then duck.map! { |d| new_decorated_obj d }
		else new @adapter.new(duck)
	end
end