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



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

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

.to_value(xml_val) ⇒ Object



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

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