Module: Exlibris::Primo::XmlUtil

Overview

Utility for parsing and building XML

Defined Under Namespace

Modules: ClassAttributes

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(klass) ⇒ Object



9
10
11
12
13
# File 'lib/exlibris/primo/xml_util.rb', line 9

def self.included(klass)
  klass.class_eval do
    extend ClassAttributes
  end
end

Instance Method Details

#to_hashObject



62
63
64
# File 'lib/exlibris/primo/xml_util.rb', line 62

def to_hash
  Hash.from_xml(to_xml)
end

#to_jsonObject



70
71
72
# File 'lib/exlibris/primo/xml_util.rb', line 70

def to_json
  to_hash.to_json
end

#to_xmlObject



66
67
68
# File 'lib/exlibris/primo/xml_util.rb', line 66

def to_xml
  xml.to_xml(xml_options).strip
end