Class: Fnsapi::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/fnsapi/configuration.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfiguration

Returns a new instance of Configuration.



19
20
21
22
23
24
25
26
27
28
29
30
# File 'lib/fnsapi/configuration.rb', line 19

def initialize
  @fns_host = 'https://openapi.nalog.ru'
  @fns_port = 8090
  @redis_key = :fnsapi_token
  @redis_url = nil
  @tmp_file_name = 'fnsapi_tmp_credentials'
  @fnsapi_master_key = nil
  @fnsapi_user_token = nil
  @get_message_timeout = 60
  @logger = defined?(Rails) ? Rails.logger : Logger.new($stdout)
  @log_enabled = false
end

Instance Attribute Details

#fns_hostObject

Returns the value of attribute fns_host.



7
8
9
# File 'lib/fnsapi/configuration.rb', line 7

def fns_host
  @fns_host
end

#fns_portObject

Returns the value of attribute fns_port.



7
8
9
# File 'lib/fnsapi/configuration.rb', line 7

def fns_port
  @fns_port
end

#fnsapi_master_keyObject



38
39
40
41
42
# File 'lib/fnsapi/configuration.rb', line 38

def fnsapi_master_key
  return @fnsapi_master_key if @fnsapi_master_key

  raise InvalidConfigurationError, 'fnsapi_master_key must be specified'
end

#fnsapi_user_tokenObject



32
33
34
35
36
# File 'lib/fnsapi/configuration.rb', line 32

def fnsapi_user_token
  return @fnsapi_user_token if @fnsapi_user_token

  raise InvalidConfigurationError, 'fnsapi_user_token must be specified'
end

#get_message_timeoutObject

Returns the value of attribute get_message_timeout.



7
8
9
# File 'lib/fnsapi/configuration.rb', line 7

def get_message_timeout
  @get_message_timeout
end

#log_enabledObject

Returns the value of attribute log_enabled.



7
8
9
# File 'lib/fnsapi/configuration.rb', line 7

def log_enabled
  @log_enabled
end

#loggerObject

Returns the value of attribute logger.



7
8
9
# File 'lib/fnsapi/configuration.rb', line 7

def logger
  @logger
end

#redis_keyObject

Returns the value of attribute redis_key.



7
8
9
# File 'lib/fnsapi/configuration.rb', line 7

def redis_key
  @redis_key
end

#redis_urlObject

Returns the value of attribute redis_url.



7
8
9
# File 'lib/fnsapi/configuration.rb', line 7

def redis_url
  @redis_url
end

#tmp_file_nameObject

Returns the value of attribute tmp_file_name.



7
8
9
# File 'lib/fnsapi/configuration.rb', line 7

def tmp_file_name
  @tmp_file_name
end