Class: Tickethub::Channel
Defined Under Namespace
Classes: Answer, Booking, Coupon, Customer, Discount, Extra, Fee, Option, Order, Payment, Product, Purchase, Question, Refund, Session, Supplier, Tax, Ticket, Tier, Variant
Instance Attribute Summary
Attributes inherited from Resource
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(endpoint, attributes = nil) ⇒ Channel
constructor
A new instance of Channel.
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) ⇒ Channel
Returns a new instance of Channel.
39 40 41 42 43 44 45 46 47 48 |
# File 'lib/tickethub/channel.rb', line 39 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