class DiscountNetwork::Booking

Public Instance Methods

create(search_id:, hotel_id:, travellers:, properties:, **attrs) click to toggle source
# File lib/discountnetwork/booking.rb, line 9
def create(search_id:, hotel_id:, travellers:, properties:, **attrs)
  attributes = attrs.merge(
    search_id: search_id,
    travellers_attributes: build_array_params(travellers),
    properties_attributes: build_array_params(
      properties.merge(property_id: hotel_id)
    )
  )

  DiscountNetwork.post_resource(
    "bookings", booking: attributes
  ).travel_request
end
find(booking_id) click to toggle source
# File lib/discountnetwork/booking.rb, line 3
def find(booking_id)
  DiscountNetwork.get_resource(
    ["bookings", booking_id].join("/")
  ).travel_request
end