Module: ToNetMeApi::Configuration

Included in:
ToNetMeApi
Defined in:
lib/to_net_me_api/configuration.rb

Overview

Генерация модуля конфигураци

ToNetMeApi::Configuration

Constant Summary collapse

OPTION_NAMES =

доступные опции для конфигурации

[
 :api_core,
 :http_verb,
]
DAFAULT_API_ADDRESS =

адрес api по умолчанию

'http://api.2net.me/'
DEFAULT_HTTP_VERB =
:post

Instance Method Summary collapse

Instance Method Details

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

Можно задавать конфигурацию для гема так: ToNetMeApi.configure {|config| config.api_core=‘sandbox.api.2net.me/’}

Yields:

  • (_self)

Yield Parameters:



20
21
22
23
# File 'lib/to_net_me_api/configuration.rb', line 20

def  configure
  yield self if block_given?
  self
end

#resetObject

установка всех конфигураций в дефолтное значение



34
35
36
37
# File 'lib/to_net_me_api/configuration.rb', line 34

def reset
  @api_core = DAFAULT_API_ADDRESS
  @http_verb = DEFAULT_HTTP_VERB
end

#set_api_coreObject



29
30
31
# File 'lib/to_net_me_api/configuration.rb', line 29

def set_api_core
  @api_core = DAFAULT_API_ADDRESS
end

#set_http_verbObject



25
26
27
# File 'lib/to_net_me_api/configuration.rb', line 25

def set_http_verb
  @http_verb = DEFAULT_HTTP_VERB
end