Class: CustomGateway::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/custom_gateway/services/base.rb

Direct Known Subclasses

CPP::Categories, CPP::Products

Constant Summary collapse

API_INTERNAL_LOGIN =
"/apis/internal/login"
API_INTERNAL_GRAPHQL =
"/apis/internal/graphql"

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeBase

Returns a new instance of Base.



10
11
12
13
14
15
16
17
18
# File 'lib/custom_gateway/services/base.rb', line 10

def initialize
  self.http_client = Faraday.new('https://cpp.custom-gateway.net/v2') do |b|
    b.request :json
    b.response :json, content_type: 'application/json'
    b.adapter Faraday.default_adapter
  end

  auth!
end

Instance Attribute Details

#g3d_cppomsObject

Returns the value of attribute g3d_cppoms.



8
9
10
# File 'lib/custom_gateway/services/base.rb', line 8

def g3d_cppoms
  @g3d_cppoms
end

#http_clientObject

Returns the value of attribute http_client.



7
8
9
# File 'lib/custom_gateway/services/base.rb', line 7

def http_client
  @http_client
end