class Fnsapi::Configuration

Attributes

fns_host[RW]
fns_port[RW]
fnsapi_master_key[W]
fnsapi_user_token[W]
get_message_timeout[RW]
log_enabled[RW]
logger[RW]
redis_key[RW]
redis_url[RW]
tmp_file_name[RW]

Public Class Methods

new() click to toggle source
# 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

Public Instance Methods

fnsapi_master_key() click to toggle source
# 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() click to toggle source
# 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