Class: Tickethub::Supplier
- Defined in:
- lib/tickethub/supplier.rb
Direct Known Subclasses
Defined Under Namespace
Classes: Adjustment, Answer, Booking, Broadcast, Channel, Charge, Coupon, Customer, Discount, Dispute, Extra, Fee, Import, Invoice, Location, Message, Option, Order, Override, Partner, Party, Payment, Product, Purchase, Question, Rate, Refund, Reseller, Scan, Season, Session, Shift, Source, Tax, Ticket, Tier, Transfer, User, Variant
Instance Attribute Summary
Attributes inherited from Resource
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(endpoint, attributes = nil) ⇒ Supplier
constructor
A new instance of Supplier.
Methods inherited from Resource
#==, #[], #[]=, all, association, attribute, attributes, call, collection, collection_method, collection_methods, descendants, #destroy, dump_value, #eql?, #errors, #hash, inherited, #inspect, #load, load_value, path, polymorphic, register_type, registered_types, #reload!, #respond_to?, scope, scopes, serialize, singleton?, #to_h, #to_param, #to_s, #update, #valid?
Constructor Details
#initialize(endpoint, attributes = nil) ⇒ Supplier
Returns a new instance of Supplier.
98 99 100 101 102 103 104 105 106 107 |
# File 'lib/tickethub/supplier.rb', line 98 def initialize(endpoint, attributes = nil) attributes ||= endpoint.get if attributes['token'] endpoint = Tickethub.endpoint(auth_type: :bearer, password: attributes['token']['access_token'])[self.class.path] end super(endpoint, attributes) end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class Tickethub::Resource