Class: RubyXmlMapper::Boolean

Inherits:
Object
  • Object
show all
Defined in:
lib/ruby-xml-mapper/basic_containers.rb

Class Method Summary collapse

Class Method Details

.new_from_xml_attr(attr) ⇒ Object



58
59
60
# File 'lib/ruby-xml-mapper/basic_containers.rb', line 58

def self.new_from_xml_attr attr
  (attr.value =~ /\A\s*true\s*\z/i) ? true : false
end

.new_from_xml_node(node) ⇒ Object



62
63
64
# File 'lib/ruby-xml-mapper/basic_containers.rb', line 62

def self.new_from_xml_node node
  (node.content =~ /\A\s*true\s*\z/i) ? true : false
end