class BookingAutomation::XMLRequest
Public Class Methods
new(auth, opts = {})
click to toggle source
# File lib/booking_automation/xml_request.rb, line 3 def initialize(auth, opts = {}) @auth = auth @opts = opts end
Public Instance Methods
to_xml()
click to toggle source
# File lib/booking_automation/xml_request.rb, line 8 def to_xml data = builder.new do |xml| xml.request do xml.auth do xml.username @auth[:username] xml.password @auth[:password] end @opts.each do |prop, value| xml.public_send prop, value end end end data.doc.root.to_xml end
Private Instance Methods
builder()
click to toggle source
# File lib/booking_automation/xml_request.rb, line 25 def builder Nokogiri::XML::Builder end