Class: Arbetsformedlingen::PacketXMLBuilder
- Inherits:
-
Object
- Object
- Arbetsformedlingen::PacketXMLBuilder
- Defined in:
- lib/arbetsformedlingen/models/packet_xml_builder.rb
Instance Method Summary collapse
-
#initialize(packet) ⇒ PacketXMLBuilder
constructor
A new instance of PacketXMLBuilder.
- #to_xml ⇒ Object
Constructor Details
#initialize(packet) ⇒ PacketXMLBuilder
Returns a new instance of PacketXMLBuilder.
7 8 9 |
# File 'lib/arbetsformedlingen/models/packet_xml_builder.rb', line 7 def initialize(packet) @packet = packet end |
Instance Method Details
#to_xml ⇒ Object
11 12 13 14 15 16 17 |
# File 'lib/arbetsformedlingen/models/packet_xml_builder.rb', line 11 def to_xml @xml ||= begin # TODO: Set option so that åäö isn't encoded builder = Builder::XmlMarkup.new(indent: 2) append_envelope(builder, @packet.to_h) end end |