Sha256: 3750b83f3d1d20e982b1b9d433cc898fd9da520b3a3639aa60951e86ed3fe314

Contents?: true

Size: 1.41 KB

Versions: 18

Compression:

Stored size: 1.41 KB

Contents

require_relative '../resource'

module Tickethub
  class Supplier::Order < Resource
    path '/supplier/orders'

    require_relative 'customer'
    require_relative 'booking'
    require_relative 'payment'

    require_relative 'reseller'
    require_relative 'customer'

    require_relative 'user'
    require_relative 'answer'
    require_relative 'message'
    require_relative 'session'
    require_relative 'location'
    require_relative 'broadcast'

    require_relative '../address'

    collection_method :broadcast do |params|
      Tickethub::Broadcast.call self.endpoint, post(:broadcast, params)
    end

    collection :bookings, Supplier::Booking
    collection :payments, Supplier::Payment
    collection :messages, Supplier::Message
    collection :answers, Supplier::Answer

    association :reseller, Supplier::Reseller
    association :customer, Supplier::Customer

    association :user, Supplier::User
    association :location, Supplier::Location
    association :session, Supplier::Session
    association :address, Tickethub::Address

    attribute :total, type: :money
    attribute :balance, type: :money
    attribute :currency, type: :currency

    attribute :expires_at, type: :datetime
    attribute :confirmed_at, type: :datetime
    attribute :created_at, type: :datetime
    attribute :updated_at, type: :datetime

    def confirm(params = {})
      self.load @endpoint[:confirm].post(params)
    end
  end
end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
tickethub-0.3.95 lib/tickethub/supplier/order.rb
tickethub-0.3.94 lib/tickethub/supplier/order.rb
tickethub-0.3.93 lib/tickethub/supplier/order.rb
tickethub-0.3.92 lib/tickethub/supplier/order.rb
tickethub-0.3.91 lib/tickethub/supplier/order.rb
tickethub-0.3.90 lib/tickethub/supplier/order.rb
tickethub-0.3.89 lib/tickethub/supplier/order.rb
tickethub-0.3.88 lib/tickethub/supplier/order.rb
tickethub-0.3.87 lib/tickethub/supplier/order.rb
tickethub-0.3.86 lib/tickethub/supplier/order.rb
tickethub-0.3.85 lib/tickethub/supplier/order.rb
tickethub-0.3.84 lib/tickethub/supplier/order.rb
tickethub-0.3.82 lib/tickethub/supplier/order.rb
tickethub-0.3.81 lib/tickethub/supplier/order.rb
tickethub-0.3.80 lib/tickethub/supplier/order.rb
tickethub-0.3.79 lib/tickethub/supplier/order.rb
tickethub-0.3.78 lib/tickethub/supplier/order.rb
tickethub-0.3.77 lib/tickethub/supplier/order.rb