Class: Tickethub::Supplier
- Defined in:
- lib/tickethub/supplier.rb
Direct Known Subclasses
Defined Under Namespace
Classes: Answer, App, Bill, Booking, Card, Charge, Coupon, Customer, Fee, Import, Invoice, Message, Option, Order, Payment, Product, Question, Rate, Receipt, Reseller, Scan, Season, Subscription, 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) ⇒ Supplier
constructor
A new instance of Supplier.
- #settings ⇒ Object
Methods inherited from Resource
#==, #[], #[]=, all, association, attribute, attributes, collection, descendants, #destroy, dump_value, #eql?, #errors, #hash, inherited, #inspect, load, #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.
72 73 74 75 76 77 78 79 80 81 |
# File 'lib/tickethub/supplier.rb', line 72 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
Class Method Details
Instance Method Details
#settings ⇒ Object
83 84 85 |
# File 'lib/tickethub/supplier.rb', line 83 def settings @endpoint[:settings].get.decoded end |