Module: OAS::AdXML::Utils

Included in:
OAS::AdXML, Response
Defined in:
lib/oas/adxml.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#parserObject



10
11
12
# File 'lib/oas/adxml.rb', line 10

def parser
  @parser ||= Nori.new(:advanced_typecasting => false, :convert_tags_to => lambda { |tag| tag.to_sym })
end

Instance Method Details

#to_hashObject



20
21
22
# File 'lib/oas/adxml.rb', line 20

def to_hash
  @hash ||= parser.parse(@doc.to_xml)
end

#to_sObject Also known as: to_xml



15
16
17
# File 'lib/oas/adxml.rb', line 15

def to_s
  @doc.to_xml
end