Sha256: e657b2c8aac01105545e20ff7803a07fd53da7806b46759d794bbb86ced4553e

Contents?: true

Size: 1.83 KB

Versions: 24

Compression:

Stored size: 1.83 KB

Contents

require 'date'
require_relative '../resource'
require_relative '../collection'

module Tickethub
  class Supplier::Product < Resource
    path '/supplier/products'

    require_relative '../contact'
    require_relative '../address'

    require_relative 'booking'
    require_relative 'voucher'
    require_relative 'ticket'
    require_relative 'extra'
    require_relative 'fee'
    require_relative 'option'
    require_relative 'tier'
    require_relative 'variant'
    require_relative 'season'
    require_relative 'rate'
    require_relative 'coupon'
    require_relative 'reseller'
    require_relative 'question'
    require_relative 'answer'
    require_relative 'tax'
    require_relative 'scan'
    require_relative 'widget'
    require_relative 'import'

    collection :bookings, Supplier::Booking
    collection :vouchers, Supplier::Voucher
    collection :tickets, Supplier::Ticket
    collection :extras, Supplier::Extra
    collection :fees, Supplier::Fee
    collection :tiers, Supplier::Tier
    collection :variants, Supplier::Variant
    collection :seasons, Supplier::Season
    collection :coupons, Supplier::Coupon
    collection :rates, Supplier::Rate
    collection :questions, Supplier::Question
    collection :answers, Supplier::Answer
    collection :taxes, Supplier::Tax
    collection :scans, Supplier::Scan
    collection :widgets, Supplier::Widget
    collection :imports, Supplier::Import

    collection :options, Supplier::Option do
      def dates(from, to, booking = {})
        @endpoint[:dates].get(from: from, to: to, booking: booking).decoded
      end
    end

    association :contact, Tickethub::Contact
    association :address, Tickethub::Address

    attribute :time_zone, type: :timezone
    attribute :currency, type: :currency

    attribute :created_at, type: :datetime
    attribute :updated_at, type: :datetime
  end
end

Version data entries

24 entries across 24 versions & 1 rubygems

Version Path
tickethub-0.3.55 lib/tickethub/supplier/product.rb
tickethub-0.3.54 lib/tickethub/supplier/product.rb
tickethub-0.3.53 lib/tickethub/supplier/product.rb
tickethub-0.3.52 lib/tickethub/supplier/product.rb
tickethub-0.3.51 lib/tickethub/supplier/product.rb
tickethub-0.3.50 lib/tickethub/supplier/product.rb
tickethub-0.3.49 lib/tickethub/supplier/product.rb
tickethub-0.3.47 lib/tickethub/supplier/product.rb
tickethub-0.3.46 lib/tickethub/supplier/product.rb
tickethub-0.3.45 lib/tickethub/supplier/product.rb
tickethub-0.3.44 lib/tickethub/supplier/product.rb
tickethub-0.3.43 lib/tickethub/supplier/product.rb
tickethub-0.3.42 lib/tickethub/supplier/product.rb
tickethub-0.3.41 lib/tickethub/supplier/product.rb
tickethub-0.3.40 lib/tickethub/supplier/product.rb
tickethub-0.3.39 lib/tickethub/supplier/product.rb
tickethub-0.3.38 lib/tickethub/supplier/product.rb
tickethub-0.3.37 lib/tickethub/supplier/product.rb
tickethub-0.3.36 lib/tickethub/supplier/product.rb
tickethub-0.3.35 lib/tickethub/supplier/product.rb