Class: FreshBooks::XmlSerializer::ObjectSerializer

Inherits:
Object
  • Object
show all
Defined in:
lib/freshbooks/xml_serializer/serializers.rb

Class Method Summary collapse

Class Method Details

.to_node(member_name, value) ⇒ Object


69
70
71
# File 'lib/freshbooks/xml_serializer/serializers.rb', line 69

def self.to_node(member_name, value)
  REXML::Document.new(value.to_xml(member_name))
end

.to_value(xml_val) ⇒ Object


73
74
75
# File 'lib/freshbooks/xml_serializer/serializers.rb', line 73

def self.to_value(xml_val)
  FreshBooks::const_get(xml_val.name.camelize)::new_from_xml(xml_val) 
end