Module: Representable::XML::ClassMethods
- Defined in:
- lib/representable/xml.rb
Instance Method Summary collapse
- #from_node(*args, &block) ⇒ Object
-
#from_xml(*args, &block) ⇒ Object
Creates a new Ruby object from XML using mapping information declared in the class.
- #remove_namespaces! ⇒ Object
Instance Method Details
#from_node(*args, &block) ⇒ Object
32 33 34 |
# File 'lib/representable/xml.rb', line 32 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>")
28 29 30 |
# File 'lib/representable/xml.rb', line 28 def from_xml(*args, &block) create_represented(*args, &block).from_xml(*args) end |
#remove_namespaces! ⇒ Object
17 18 19 |
# File 'lib/representable/xml.rb', line 17 def remove_namespaces! representable_attrs.[:remove_namespaces] = true end |