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, 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, endpoint, #eql?, #errors, #hash, inherited, #inspect, load, #load, load_value, path, polymorphic, register_type, registered_types, #reload!, #respond_to?, scope, scopes, serialize, #to_h, #to_param, #to_s, #update, #valid?
Constructor Details
#initialize(endpoint, attributes = nil) ⇒ Supplier
Returns a new instance of Supplier.
69 70 71 72 73 74 75 76 77 78 |
# File 'lib/tickethub/supplier.rb', line 69 def initialize(endpoint, attributes = nil) attributes ||= endpoint.get if attributes['token'] endpoint = Tickethub.endpoint['/supplier', { auth_type: :bearer, password: attributes['token']['access_token'] }] 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
80 81 82 |
# File 'lib/tickethub/supplier.rb', line 80 def settings @endpoint[:settings].get.decoded end |