Class: HostConnect::GetBookingBuilder

Inherits:
AbstractBuilder show all
Defined in:
lib/hostconnect/builders/get_booking_builder.rb

Overview

This request retrieves a booking. Note that for a booking to be retrieved successfully the agent requesting the booking must be the same as the agent who made the booking.

Instance Method Summary collapse

Methods inherited from AbstractBuilder

#submit, #to_s

Constructor Details

#initialize(options = {}) ⇒ GetBookingBuilder

Returns a new instance of GetBookingBuilder.



6
7
8
9
# File 'lib/hostconnect/builders/get_booking_builder.rb', line 6

def initialize(options = {})
  @valid_options = [ :agent_id, :password, :booking_id, :ref ].freeze
  super(options)
end

Instance Method Details

#to_xmlObject



11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/hostconnect/builders/get_booking_builder.rb', line 11

def to_xml
  x = bare
  x.Request {
    x.GetBookingRequest {
      x.AgentID @agent_id
      x.Password @password
      x.BookingId @booking_id if @booking_id
      x.Ref @ref if @ref
    }
  }
  x
end