Class: BrickFTP::Configuration
- Inherits:
-
Object
- Object
- BrickFTP::Configuration
- Defined in:
- lib/brick_ftp/configuration.rb
Constant Summary collapse
- DEFAULT_OPEN_TIMEOUT =
10- DEFAULT_READ_TIMEOUT =
30
Instance Attribute Summary collapse
-
#api_key ⇒ String
Access key of API.
-
#log_formatter ⇒ Logger::Formatter
Log formatter.
-
#log_level ⇒ Integer
Log level.
-
#logger ⇒ Logger
Logger.
-
#open_timeout ⇒ Integer
Open timeout.
-
#read_timeout ⇒ Integer
Read timeout.
-
#session ⇒ BrickFTP::API::Authentication::Session
Authentication session for cookie auth.
-
#subdomain ⇒ String
Subdomain of API endpoint.
Instance Method Summary collapse
-
#api_host ⇒ String
Host name of API endpoint.
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
33 34 35 36 37 38 39 40 41 42 43 |
# File 'lib/brick_ftp/configuration.rb', line 33 def initialize self.subdomain = ENV['BRICK_FTP_SUBDOMAIN'] self.api_key = ENV['BRICK_FTP_API_KEY'] self.session = nil self.open_timeout = DEFAULT_OPEN_TIMEOUT self.read_timeout = DEFAULT_READ_TIMEOUT self.logger = Logger.new(STDOUT) self.log_level = Logger::WARN self.log_formatter = Logger::Formatter.new logger.level = log_level end |
Instance Attribute Details
#api_key ⇒ String
Access key of API. If not specified, get value from enviroment variable BRICK_FTP_API_KEY.
10 11 12 |
# File 'lib/brick_ftp/configuration.rb', line 10 def api_key @api_key end |
#log_formatter ⇒ Logger::Formatter
Log formatter
22 23 24 |
# File 'lib/brick_ftp/configuration.rb', line 22 def log_formatter @log_formatter end |
#log_level ⇒ Integer
Log level
19 20 21 |
# File 'lib/brick_ftp/configuration.rb', line 19 def log_level @log_level end |
#logger ⇒ Logger
Logger.
16 17 18 |
# File 'lib/brick_ftp/configuration.rb', line 16 def logger @logger end |
#open_timeout ⇒ Integer
Open timeout
25 26 27 |
# File 'lib/brick_ftp/configuration.rb', line 25 def open_timeout @open_timeout end |
#read_timeout ⇒ Integer
Read timeout
28 29 30 |
# File 'lib/brick_ftp/configuration.rb', line 28 def read_timeout @read_timeout end |
#session ⇒ BrickFTP::API::Authentication::Session
Authentication session for cookie auth.
13 14 15 |
# File 'lib/brick_ftp/configuration.rb', line 13 def session @session end |
#subdomain ⇒ String
Subdomain of API endpoint. If not specified, get value from enviroment variable BRICK_FTP_SUBDOMAIN.
7 8 9 |
# File 'lib/brick_ftp/configuration.rb', line 7 def subdomain @subdomain end |
Instance Method Details
#api_host ⇒ String
Host name of API endpoint.
47 48 49 |
# File 'lib/brick_ftp/configuration.rb', line 47 def api_host "#{subdomain}.brickftp.com" end |