Sha256: 4d517e2b4bdb457a84287bd30e91d97a8e4c7b7273ad22fa086280f42f19d933

Contents?: true

Size: 618 Bytes

Versions: 4

Compression:

Stored size: 618 Bytes

Contents

module DiscountNetwork
  class Booking < Base
    def find(booking_id)
      DiscountNetwork.get_resource(
        ["bookings", booking_id].join("/")
      ).travel_request
    end

    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
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
discountnetwork-0.1.3 lib/discountnetwork/booking.rb
discountnetwork-0.1.2 lib/discountnetwork/booking.rb
discountnetwork-0.1.1 lib/discountnetwork/booking.rb
discountnetwork-0.1.0 lib/discountnetwork/booking.rb