Module: AdGear::XmlFormat

Extended by:
XmlFormat
Included in:
XmlFormat
Defined in:
lib/ad_gear/xml_format.rb

Overview

Copied from ActiveResource’s active_resource/formats/xml_format.rb. Changed mime_type to return AdGear’s expected mime type.

Instance Method Summary collapse

Instance Method Details

#decode(xml) ⇒ Object



20
21
22
# File 'lib/ad_gear/xml_format.rb', line 20

def decode(xml)
  from_xml_data(Hash.from_xml(xml))
end

#encode(hash, options = {}) ⇒ Object



16
17
18
# File 'lib/ad_gear/xml_format.rb', line 16

def encode(hash, options={})
  hash.to_xml(options)
end

#extensionObject



8
9
10
# File 'lib/ad_gear/xml_format.rb', line 8

def extension
  "agml"
end

#mime_typeObject



12
13
14
# File 'lib/ad_gear/xml_format.rb', line 12

def mime_type
  "application/vnd.bloom.adgear.v1+xml"
end