Class: Pdf4me::Configuration
- Inherits:
-
Object
- Object
- Pdf4me::Configuration
- Defined in:
- lib/pdf4me/configuration.rb
Instance Attribute Summary collapse
-
#debugging ⇒ Object
Returns the value of attribute debugging.
-
#host ⇒ Object
Returns the value of attribute host.
-
#logger ⇒ Object
Returns the value of attribute logger.
-
#token ⇒ Object
Returns the value of attribute token.
Class Method Summary collapse
Instance Method Summary collapse
- #base_url ⇒ Object
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
10 11 12 13 14 15 |
# File 'lib/pdf4me/configuration.rb', line 10 def initialize @host = 'api.pdf4me.com' @token = ENV['PDF4ME_TOKEN'] @debugging = false @logger = defined?(Rails) ? Rails.logger : Logger.new(STDOUT) end |
Instance Attribute Details
#debugging ⇒ Object
Returns the value of attribute debugging.
3 4 5 |
# File 'lib/pdf4me/configuration.rb', line 3 def debugging @debugging end |
#host ⇒ Object
Returns the value of attribute host.
3 4 5 |
# File 'lib/pdf4me/configuration.rb', line 3 def host @host end |
#logger ⇒ Object
Returns the value of attribute logger.
3 4 5 |
# File 'lib/pdf4me/configuration.rb', line 3 def logger @logger end |
#token ⇒ Object
Returns the value of attribute token.
3 4 5 |
# File 'lib/pdf4me/configuration.rb', line 3 def token @token end |
Class Method Details
.default ⇒ Object
17 18 19 |
# File 'lib/pdf4me/configuration.rb', line 17 def self.default @@default ||= Configuration.new end |
Instance Method Details
#base_url ⇒ Object
25 26 27 28 |
# File 'lib/pdf4me/configuration.rb', line 25 def base_url url = "https://#{host}" URI.encode(url).freeze end |