Class: Payture::Api

Inherits:
Object
  • Object
show all
Includes:
Connection, Request
Defined in:
lib/payture/api.rb

Direct Known Subclasses

Client

Instance Method Summary collapse

Methods included from Request

#delete, #get, #post, #put

Constructor Details

#initialize(options = {}) ⇒ Api

Returns a new instance of Api.



9
10
11
12
13
14
# File 'lib/payture/api.rb', line 9

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

Instance Method Details

#convert_to_underscore(key) ⇒ Object



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

def convert_to_underscore(key)
  key.scan(/[A-Z][a-z]*/).join("_").downcase
end

#hostObject



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

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