Class: Fate::Output::Handlers
- Inherits:
-
Object
- Object
- Fate::Output::Handlers
- Defined in:
- lib/fate/output.rb
Instance Method Summary collapse
- #[](name) ⇒ Object
-
#initialize(service, handlers) ⇒ Handlers
constructor
A new instance of Handlers.
Constructor Details
#initialize(service, handlers) ⇒ Handlers
Returns a new instance of Handlers.
6 7 8 9 |
# File 'lib/fate/output.rb', line 6 def initialize(service, handlers) @service = service @handlers = handlers end |
Instance Method Details
#[](name) ⇒ Object
11 12 13 14 15 16 17 18 19 |
# File 'lib/fate/output.rb', line 11 def [](name) if handler = @handlers[name] handler elsif @handlers["default"] @handlers[name] = @handlers["default"][name] else @handlers[name] = @service.logger[name] end end |