Sha256: 1c49f45193ca8034739c3bdd229d4301359666201dfd52b8c72cf45f91a0dd4b

Contents?: true

Size: 967 Bytes

Versions: 45

Compression:

Stored size: 967 Bytes

Contents

module Centaman
  class Service::HoldTicket < Centaman::Service
    attr_reader :timed_ticket_type_id, :timed_ticket_id, :quantity

    def after_init(args)
      @timed_ticket_type_id = args[:timed_ticket_type_id]
      @timed_ticket_id = args[:timed_ticket_id]
      @quantity = args[:quantity]
    end

    def after_post(response)
      response.parsed_response
    end

    def endpoint
      '/ticket_services/TimedTicketType'
    end

    def object_class
      Centaman::Object::BookingTime
    end

    def options_hash
      [
        {
          'TimedTicketTypeId' => timed_ticket_type_id.to_i,
          'TimedTicketId' => timed_ticket_id,
          'NumberOfTickets' => quantity
        }
      ].to_json
    end

    def options
      super + [
        { key: 'TimedTicketTypeId', value: timed_ticket_type_id.to_i },
        { key: 'TimedTicketId', value: timed_ticket_id },
        { key: 'NumberOfTickets', value: quantity }
      ]
    end
  end
end

Version data entries

45 entries across 45 versions & 1 rubygems

Version Path
centaman-8.0.0 lib/centaman/service/hold_ticket.rb
centaman-7.0.5 lib/centaman/service/hold_ticket.rb
centaman-7.0.4 lib/centaman/service/hold_ticket.rb
centaman-7.0.3 lib/centaman/service/hold_ticket.rb
centaman-7.0.2 lib/centaman/service/hold_ticket.rb
centaman-7.0.1 lib/centaman/service/hold_ticket.rb
centaman-7.0.0 lib/centaman/service/hold_ticket.rb
centaman-6.0.8 lib/centaman/service/hold_ticket.rb
centaman-6.0.7 lib/centaman/service/hold_ticket.rb
centaman-6.0.5 lib/centaman/service/hold_ticket.rb
centaman-6.0.4 lib/centaman/service/hold_ticket.rb
centaman-6.0.3 lib/centaman/service/hold_ticket.rb
centaman-6.0.2 lib/centaman/service/hold_ticket.rb
centaman-6.0.1 lib/centaman/service/hold_ticket.rb
centaman-6.0.0 lib/centaman/service/hold_ticket.rb
centaman-5.0.8 lib/centaman/service/hold_ticket.rb
centaman-5.0.7 lib/centaman/service/hold_ticket.rb
centaman-5.0.6 lib/centaman/service/hold_ticket.rb
centaman-5.0.5 lib/centaman/service/hold_ticket.rb
centaman-5.0.4 lib/centaman/service/hold_ticket.rb