module Cropio::Connection::Configurable

Contains logic for requests configuration like appending headers to requests.

Constants

BASE_URL

Cropio's server and API's entry point url

Protected Instance Methods

authenticated_headers() click to toggle source

Returns headers for authenticated queries.

# File lib/cropio/connection/configurable.rb, line 22
def authenticated_headers
  authentication_headers.merge(
    'X-User-Api-Token' => Cropio.credentials.api_token)
end
authentication_headers() click to toggle source

Returns headers for authentication query.

# File lib/cropio/connection/configurable.rb, line 17
def authentication_headers
  { content_type: :json, accept: :json }
end
headers() click to toggle source

Returns headers set for request.

# File lib/cropio/connection/configurable.rb, line 12
def headers
  authenticated? ? authenticated_headers : authentication_headers
end