Class: Luma::Provider

Inherits:
Connection show all
Defined in:
lib/luma/provider.rb

Constant Summary collapse

PROVIDER_ENDPOINT =
'/api/providers'.freeze

Constants inherited from Connection

Connection::DEFAULT_ENDPOINT

Instance Method Summary collapse

Methods inherited from Connection

#add_headers_and_body, #initialize, #request

Constructor Details

This class inherits a constructor from Luma::Connection

Instance Method Details

#create_provider(endpoint: PROVIDER_ENDPOINT, body: nil, headers: {}, auth: true, verb: :post) ⇒ Object



7
8
9
10
11
12
13
# File 'lib/luma/provider.rb', line 7

def create_provider(endpoint: PROVIDER_ENDPOINT, body: nil, headers: {}, auth: true, verb: :post)
   @body = body

   self.add_headers_and_body if auth

   self.class.send(verb.to_s, endpoint, body: @body, headers: @headers, debug_output: $stdout)
end