Module: FreshBooks::XmlSerializer

Defined in:
lib/freshbooks/xml_serializer.rb,
lib/freshbooks/xml_serializer/serializers.rb

Defined Under Namespace

Classes: ArraySerializer, BooleanSerializer, DateSerializer, DateTimeSerializer, FixnumSerializer, FloatSerializer, ObjectSerializer, StringSerializer

Class Method Summary collapse

Class Method Details

.create_serializer(type) ⇒ Object



13
14
15
# File 'lib/freshbooks/xml_serializer.rb', line 13

def self.create_serializer(type)
  "FreshBooks::XmlSerializer::#{type.to_s.classify}Serializer".constantize
end

.to_node(member_name, value, type) ⇒ Object



9
10
11
# File 'lib/freshbooks/xml_serializer.rb', line 9

def self.to_node(member_name, value, type)
  create_serializer(type).to_node(member_name, value)
end

.to_value(node, type) ⇒ Object



5
6
7
# File 'lib/freshbooks/xml_serializer.rb', line 5

def self.to_value(node, type)
  create_serializer(type).to_value(node)
end