Method: Tickethub::Channel#initialize

Defined in:
lib/tickethub/channel.rb

#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