Class: Tickethub::Reseller
- Defined in:
- lib/tickethub/reseller.rb
Direct Known Subclasses
Defined Under Namespace
Classes: Answer, Booking, Channel, Customer, Discount, Extra, Fee, Invoice, Option, Order, Payment, Product, Purchase, Question, Refund, Scan, Source, Supplier, Tax, Ticket, Tier, User, Variant, Voucher
Instance Attribute Summary
Attributes inherited from Resource
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(endpoint, attributes = nil) ⇒ Reseller
constructor
A new instance of Reseller.
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) ⇒ Reseller
Returns a new instance of Reseller.
73 74 75 76 77 78 79 80 81 82 |
# File 'lib/tickethub/reseller.rb', line 73 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