class Tickethub::Channel

Public Class Methods

[](attributes) click to toggle source
# File lib/tickethub/channel.rb, line 33
def self.[](attributes)
  token = attributes[:token].is_a?(String) ? attributes[:token]
    : attributes[:token][:access_token]
  self.call Tickethub.endpoint(auth_type: :bearer, password: token)[path]
end
new(endpoint, attributes = nil) click to toggle source
Calls superclass method
# 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