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)
-
- (Object) key
:nodoc:.
-
- (Object) typhoeus
:nodoc:.
Instance Method Summary (collapse)
-
- (Object) debug=(true_or_false)
:nodoc:.
-
- (Boolean) debug?
:nodoc:.
-
- (Configuration) initialize
constructor
:nodoc:.
-
- (Object) logger
:nodoc:.
-
- (Object) logger=(log)
:nodoc:.
-
- (Object) reset
reset configuration.
Constructor Details
- (Configuration) initialize
:nodoc:
23 24 25 |
# File 'lib/embedly/configuration.rb', line 23 def initialize # :nodoc: self.reset end |
Instance Attribute Details
- (Object) key
:nodoc:
21 22 23 |
# File 'lib/embedly/configuration.rb', line 21 def key @key end |
- (Object) typhoeus
:nodoc:
21 22 23 |
# File 'lib/embedly/configuration.rb', line 21 def typhoeus @typhoeus end |
Instance Method Details
- (Object) debug=(true_or_false)
:nodoc:
31 32 33 |
# File 'lib/embedly/configuration.rb', line 31 def debug=(true_or_false) # :nodoc: set_logger_level(true_or_false) end |
- (Boolean) debug?
:nodoc:
27 28 29 |
# File 'lib/embedly/configuration.rb', line 27 def debug? # :nodoc: self.logger.debug? end |
- (Object) logger
:nodoc:
35 36 37 |
# File 'lib/embedly/configuration.rb', line 35 def logger # :nodoc: @logger ||= default_logger end |
- (Object) logger=(log)
:nodoc:
39 40 41 42 |
# File 'lib/embedly/configuration.rb', line 39 def logger=(log) # :nodoc: @logger = log set_logger_level(self.debug?) end |
- (Object) reset
reset configuration
45 46 47 48 |
# File 'lib/embedly/configuration.rb', line 45 def reset self.logger = default_logger self.debug = false end |