Class: Fnsapi::Configuration
- Inherits:
-
Object
- Object
- Fnsapi::Configuration
- Defined in:
- lib/fnsapi/configuration.rb
Instance Attribute Summary collapse
-
#fns_host ⇒ Object
Returns the value of attribute fns_host.
-
#fns_port ⇒ Object
Returns the value of attribute fns_port.
- #fnsapi_master_key ⇒ Object
- #fnsapi_user_token ⇒ Object
-
#get_message_timeout ⇒ Object
Returns the value of attribute get_message_timeout.
-
#log_enabled ⇒ Object
Returns the value of attribute log_enabled.
-
#logger ⇒ Object
Returns the value of attribute logger.
-
#redis_key ⇒ Object
Returns the value of attribute redis_key.
-
#redis_url ⇒ Object
Returns the value of attribute redis_url.
-
#tmp_file_name ⇒ Object
Returns the value of attribute tmp_file_name.
Instance Method Summary collapse
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
Constructor Details
#initialize ⇒ Configuration
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_host ⇒ Object
Returns the value of attribute fns_host.
7 8 9 |
# File 'lib/fnsapi/configuration.rb', line 7 def fns_host @fns_host end |
#fns_port ⇒ Object
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_key ⇒ Object
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_token ⇒ Object
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_timeout ⇒ Object
Returns the value of attribute get_message_timeout.
7 8 9 |
# File 'lib/fnsapi/configuration.rb', line 7 def @get_message_timeout end |
#log_enabled ⇒ Object
Returns the value of attribute log_enabled.
7 8 9 |
# File 'lib/fnsapi/configuration.rb', line 7 def log_enabled @log_enabled end |
#logger ⇒ Object
Returns the value of attribute logger.
7 8 9 |
# File 'lib/fnsapi/configuration.rb', line 7 def logger @logger end |
#redis_key ⇒ Object
Returns the value of attribute redis_key.
7 8 9 |
# File 'lib/fnsapi/configuration.rb', line 7 def redis_key @redis_key end |
#redis_url ⇒ Object
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_name ⇒ Object
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 |