Module: Representable::XML::ClassMethods

Defined in:
lib/representable/xml.rb

Instance Method Summary collapse

Instance Method Details

#from_node(*args, &block) ⇒ Object



28
29
30
# File 'lib/representable/xml.rb', line 28

def from_node(*args, &block)
  create_represented(*args, &block).from_node(*args)
end

#from_xml(*args, &block) ⇒ Object

Creates a new Ruby object from XML using mapping information declared in the class.

Accepts a block yielding the currently iterated Definition. If the block returns false the property is skipped.

Example:

band.from_xml("<band><name>Nofx</name></band>")


24
25
26
# File 'lib/representable/xml.rb', line 24

def from_xml(*args, &block)
  create_represented(*args, &block).from_xml(*args)
end