Class: Cb::Clients::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/cb/clients/base.rb

Class Method Summary collapse

Class Method Details

.cb_client(headers: {}, use_default_params: true) ⇒ Object



15
16
17
# File 'lib/cb/clients/base.rb', line 15

def cb_client(headers: {}, use_default_params: true)
  @cb_client ||= Cb::Utils::Api.instance(headers: headers, use_default_params: use_default_params)
end

.headers(args, accept_header: 'application/json') ⇒ Object



19
20
21
22
23
24
25
# File 'lib/cb/clients/base.rb', line 19

def headers(args, accept_header: 'application/json')
  {
     'Accept' => accept_header,
     'Authorization' => "Bearer #{ args[:oauth_token] }",
     'Content-Type' => 'application/json'
  }
end