Class: BrickFTP::Configuration
- Inherits:
-
Object
- Object
- BrickFTP::Configuration
- Defined in:
- lib/brick_ftp/configuration.rb
Instance Attribute Summary collapse
-
#api_key ⇒ String
Access key of API.
-
#logger ⇒ Logger
Logger.
-
#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.
18 19 20 21 22 23 24 25 |
# File 'lib/brick_ftp/configuration.rb', line 18 def initialize self.subdomain = ENV['BRICK_FTP_SUBDOMAIN'] self.api_key = ENV['BRICK_FTP_API_KEY'] self.session = nil self.logger = Logger.new(STDOUT) logger.level = Logger::WARN 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 |
#logger ⇒ Logger
Logger.
16 17 18 |
# File 'lib/brick_ftp/configuration.rb', line 16 def logger @logger 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.
29 30 31 |
# File 'lib/brick_ftp/configuration.rb', line 29 def api_host "#{subdomain}.brickftp.com" end |