Class: Callapi::Config

Inherits:
Object
  • Object
show all
Defined in:
lib/callapi/config.rb

Constant Summary collapse

DEFAULT_REQUEST_STRATEGY =
'Callapi::Call::Request::Api'
DEFAULT_RESPONSE_PARSER =
'Callapi::Call::Parser::Json'
DEFAULT_MOCKS_DIRECTORY =
'mocked_calls'
DEFAULT_PATH_PREFIX =
nil

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.api_hostObject

Returns the value of attribute api_host.



9
10
11
# File 'lib/callapi/config.rb', line 9

def api_host
  @api_host
end

.api_path_prefixObject



20
21
22
# File 'lib/callapi/config.rb', line 20

def api_path_prefix
  @api_path_prefix ||= DEFAULT_PATH_PREFIX
end

.default_request_strategyObject



16
17
18
# File 'lib/callapi/config.rb', line 16

def default_request_strategy
  @default_request_strategy ||= Kernel.const_get DEFAULT_REQUEST_STRATEGY
end

.default_response_parserObject



24
25
26
# File 'lib/callapi/config.rb', line 24

def default_response_parser
  @default_response_parser ||= Kernel.const_get DEFAULT_RESPONSE_PARSER
end

.mocks_directoryObject

Returns the value of attribute mocks_directory.



8
9
10
# File 'lib/callapi/config.rb', line 8

def mocks_directory
  @mocks_directory
end

Class Method Details

.configure {|_self| ... } ⇒ Object

Yields:

  • (_self)

Yield Parameters:



12
13
14
# File 'lib/callapi/config.rb', line 12

def configure
  yield self if block_given?
end

.log_levelObject



52
53
54
# File 'lib/callapi/config.rb', line 52

def log_level
  @log_level ||= :debug
end

.log_level=(log_level) ⇒ Object



48
49
50
# File 'lib/callapi/config.rb', line 48

def log_level=(log_level)
  @log_level = log_level
end