Class: BookingAutomation::XMLRequest
- Inherits:
-
Object
- Object
- BookingAutomation::XMLRequest
- Defined in:
- lib/booking_automation/xml_request.rb
Instance Method Summary collapse
-
#initialize(auth, opts = {}) ⇒ XMLRequest
constructor
A new instance of XMLRequest.
- #to_xml ⇒ Object
Constructor Details
#initialize(auth, opts = {}) ⇒ XMLRequest
Returns a new instance of XMLRequest.
3 4 5 6 |
# File 'lib/booking_automation/xml_request.rb', line 3 def initialize(auth, opts = {}) @auth = auth @opts = opts end |
Instance Method Details
#to_xml ⇒ Object
8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
# 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 |