Class: Libis::Services::Rosetta::Producer
- Inherits:
-
Object
- Object
- Libis::Services::Rosetta::Producer
- Defined in:
- lib/libis/services/rosetta/producer.rb
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.from_xml(xml) ⇒ Object
58 59 60 61 62 63 64 65 66 67 |
# File 'lib/libis/services/rosetta/producer.rb', line 58 def self.from_xml(xml) xml_doc = Libis::Tools::XmlDocument.parse(xml) hash = xml_doc.to_hash( strip_namespaces: true, delete_namespace_attributes: true, empty_tag_value: nil, convert_tags_to: lambda { |tag| tag.to_sym } ) self.new(hash[:producer_info]) end |
Instance Method Details
#to_hash ⇒ Object
42 43 44 |
# File 'lib/libis/services/rosetta/producer.rb', line 42 def to_hash attributes.cleanup end |
#to_xml ⇒ Object
46 47 48 49 50 51 52 53 54 55 56 |
# File 'lib/libis/services/rosetta/producer.rb', line 46 def to_xml Libis::Tools::XmlDocument.build do |xml| # noinspection RubyResolve xml.producer_info { xml.parent.default_namespace = 'http://www.exlibrisgroup.com/xsd/dps/backoffice/service' self.attributes.each do |name, value| xml.send(name, xmlns: '').text(value) if value end } end.to_xml end |