Class: Payture::Api::V1::Client
- Inherits:
-
Object
- Object
- Payture::Api::V1::Client
- 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
- #api_methods ⇒ Object
-
#initialize(options = {}) ⇒ Client
constructor
A new instance of Client.
- #url ⇒ Object
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(={}) = Payture::Api::V1..merge() Configuration::VALID_OPTIONS_KEYS.each do |key| send("#{key}=", [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_methods ⇒ Object
23 24 25 |
# File 'lib/payture/api/v1/client.rb', line 23 def api_methods API_METHODS.map{|method| method.to_snakecase } end |
#url ⇒ Object
19 20 21 |
# File 'lib/payture/api/v1/client.rb', line 19 def url "https://#{host}.#{Configuration::DOMAIN}/#{api_type}/" end |