Class: Catalogcat::Client

Inherits:
Footrest::Client
  • Object
show all
Defined in:
lib/catalogcat/client.rb,
lib/catalogcat/client/orders.rb,
lib/catalogcat/client/courses.rb,
lib/catalogcat/client/catalogs.rb,
lib/catalogcat/client/enrollments.rb,
lib/catalogcat/client/certificates.rb,
lib/catalogcat/client/email_domain_sets.rb,
lib/catalogcat/client/user_registrations.rb

Defined Under Namespace

Modules: Catalogs, Certificates, Courses, EmailDomainSets, Enrollments, Orders, UserRegistrations

Instance Method Summary collapse

Instance Method Details

#request(method, &block) ⇒ Object

Override Footrest request for ApiArray support



20
21
22
23
24
# File 'lib/catalogcat/client.rb', line 20

def request(method, &block)
  response = connection.send(method, &block)

  Catalogcat::ApiArray.process_response(response, self)
end

#set_connection(config) ⇒ Object

Override Footrest connection to use Token authorization



14
15
16
17
# File 'lib/catalogcat/client.rb', line 14

def set_connection(config)
  super
  connection.headers[:authorization].sub! 'Bearer', 'Token'
end