lib/tickethub/supplier.rb in tickethub-0.3.7 vs lib/tickethub/supplier.rb in tickethub-0.3.9
- old
+ new
@@ -24,10 +24,11 @@
require_relative 'supplier/tax'
require_relative 'supplier/fee'
require_relative 'supplier/message'
require_relative 'supplier/charge'
require_relative 'supplier/import'
+ require_relative 'supplier/broadcast'
require_relative 'contact'
require_relative 'token'
collection :bills, Bill
@@ -53,10 +54,11 @@
collection :taxes, Tax
collection :fees, Fee
collection :messages, Message
collection :charges, Charge
collection :imports, Import
+ collection :broadcasts, Broadcast
association :contact, Tickethub::Contact
association :token, Tickethub::Token
attribute :country, type: :country
@@ -67,10 +69,10 @@
attribute :updated_at, type: :datetime
def self.[](attributes)
token = attributes[:token].is_a?(String) ? attributes[:token]
: attributes[:token][:access_token]
- self.load Tickethub.endpoint(auth_type: :bearer, password: token)[path]
+ self.call Tickethub.endpoint(auth_type: :bearer, password: token)[path]
end
def initialize(endpoint, attributes = nil)
attributes ||= endpoint.get
\ No newline at end of file