Class: Payture::Api::V1::Client

Inherits:
Object
  • Object
show all
Defined in:
lib/payture/api/v1/client.rb,
lib/payture/api/v1/client/payture_api.rb,
lib/payture/api/v1/client/payture_apim.rb,
lib/payture/api/v1/client/payture_vwapi.rb

Defined Under Namespace

Modules: PaytureApi, PaytureApim, PaytureVwapi

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ Client

Returns a new instance of Client.



8
9
10
11
12
13
14
15
16
17
# File 'lib/payture/api/v1/client.rb', line 8

def initialize(options={})
  options = Payture::Api::V1.options.merge(options)
  Configuration::VALID_OPTIONS_KEYS.each do |key|
    send("#{key}=", options[key])
  end

  self.class.send(:include, Client::PaytureApi) if 'api' == self.api_type
  self.class.send(:include, Client::PaytureApim) if 'apim' == self.api_type
  self.class.send(:include, Client::PaytureVwapi) if 'vwapi' == self.api_type
end

Instance Method Details

#api_methodsObject



23
24
25
# File 'lib/payture/api/v1/client.rb', line 23

def api_methods
  API_METHODS.map{|method| method.to_snakecase }
end

#urlObject



19
20
21
# File 'lib/payture/api/v1/client.rb', line 19

def url
  "https://#{host}.#{Configuration::DOMAIN}/#{api_type}/"
end