Class: Embedly::Configuration
- Inherits:
-
Object
- Object
- Embedly::Configuration
- Defined in:
- lib/embedly/configuration.rb
Overview
Configure the api
Available settings
debug
-
Prints debugging information to logger. Default
false
. Errors still will be logged
logger
-
Configure the logger; set this if you want to use a custom logger.
Usage
Embedly.configure do |config|
# prints debug messages
config.debug = true
# customize the logger
config.logger = MyAwesomeLogger.new(STDERR)
end
Instance Attribute Summary collapse
-
#key ⇒ Object
:nodoc:.
-
#typhoeus ⇒ Object
:nodoc:.
Instance Method Summary collapse
-
#debug=(true_or_false) ⇒ Object
:nodoc:.
-
#debug? ⇒ Boolean
:nodoc:.
-
#initialize ⇒ Configuration
constructor
:nodoc:.
-
#logger ⇒ Object
:nodoc:.
-
#logger=(log) ⇒ Object
:nodoc:.
-
#reset ⇒ Object
reset configuration.
Constructor Details
#initialize ⇒ Configuration
:nodoc:
23 24 25 |
# File 'lib/embedly/configuration.rb', line 23 def initialize # :nodoc: self.reset end |
Instance Attribute Details
#key ⇒ Object
:nodoc:
21 22 23 |
# File 'lib/embedly/configuration.rb', line 21 def key @key end |
#typhoeus ⇒ Object
:nodoc:
21 22 23 |
# File 'lib/embedly/configuration.rb', line 21 def typhoeus @typhoeus end |
Instance Method Details
#debug=(true_or_false) ⇒ Object
:nodoc:
31 32 33 |
# File 'lib/embedly/configuration.rb', line 31 def debug=(true_or_false) # :nodoc: set_logger_level(true_or_false) end |
#debug? ⇒ Boolean
:nodoc:
27 28 29 |
# File 'lib/embedly/configuration.rb', line 27 def debug? # :nodoc: self.logger.debug? end |
#logger ⇒ Object
:nodoc:
35 36 37 |
# File 'lib/embedly/configuration.rb', line 35 def logger # :nodoc: @logger ||= default_logger end |
#logger=(log) ⇒ Object
:nodoc:
39 40 41 42 |
# File 'lib/embedly/configuration.rb', line 39 def logger=(log) # :nodoc: @logger = log set_logger_level(self.debug?) end |
#reset ⇒ Object
reset configuration
45 46 47 48 |
# File 'lib/embedly/configuration.rb', line 45 def reset self.logger = default_logger self.debug = false end |