Class: ApimaticCalculator::Client

Inherits:
Object
  • Object
show all
Defined in:
lib/apimatic_calculator/client.rb

Overview

apimatic_calculator client class.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(timeout: 60, max_retries: 0, retry_interval: 1, backoff_factor: 1, environment: Environment::PRODUCTION, config: nil) ⇒ Client

Returns a new instance of Client.



17
18
19
20
21
22
23
24
25
26
27
28
# File 'lib/apimatic_calculator/client.rb', line 17

def initialize(timeout: 60, max_retries: 0, retry_interval: 1,
               backoff_factor: 1, environment: Environment::PRODUCTION,
               config: nil)
  @config = if config.nil?
              Configuration.new(timeout: timeout, max_retries: max_retries,
                                retry_interval: retry_interval,
                                backoff_factor: backoff_factor,
                                environment: environment)
            else
              config
            end
end

Instance Attribute Details

#configObject (readonly)

Returns the value of attribute config.



9
10
11
# File 'lib/apimatic_calculator/client.rb', line 9

def config
  @config
end

Instance Method Details

#simple_calculatorSimpleCalculatorController

Access to simple_calculator controller.

Returns:



13
14
15
# File 'lib/apimatic_calculator/client.rb', line 13

def simple_calculator
  @simple_calculator ||= SimpleCalculatorController.new config
end