Sha256: 5cc7494b6dded57446fab914b0607e96293f814894b0f7d1a2afe6f31dddb996

Contents?: true

Size: 599 Bytes

Versions: 4

Compression:

Stored size: 599 Bytes

Contents

require 'quick_travel/adapter'

module QuickTravel
  class Document < Adapter
    attr_accessor :id, :booking_id, :name

    self.api_base = "/front_office/bookings/#{@booking_id}/documents"

    # We used to direct the browser to QT directly
    # Now, we proxy over to it, and return the data
    # def pdf_url
    # #"#{QuickTravel.config.url}/api/bookings/#{@booking_id}/documents/#{@id}.pdf?key=#{access_key("document:#{@id}")}"
    # end

    # Do a second request fetching the PDF
    def fetch_pdf
      get_and_validate "/api/bookings/#{@booking_id}/documents/#{@id}.pdf"
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
quicktravel_client-1.1.2 lib/quick_travel/document.rb
quicktravel_client-1.1.1 lib/quick_travel/document.rb
quicktravel_client-1.1.0 lib/quick_travel/document.rb
quicktravel_client-1.0.2 lib/quick_travel/document.rb