Class: FTPMVC::Application
- Inherits:
-
Object
- Object
- FTPMVC::Application
- Extended by:
- Forwardable
- Includes:
- Logger
- Defined in:
- lib/ftpmvc/application.rb
Instance Method Summary collapse
- #auth ⇒ Object
- #handle_exception(e) ⇒ Object
-
#initialize(&block) ⇒ Application
constructor
A new instance of Application.
Methods included from Logger
Constructor Details
#initialize(&block) ⇒ Application
Returns a new instance of Application.
15 16 17 18 19 |
# File 'lib/ftpmvc/application.rb', line 15 def initialize(&block) @fs = Directory.new @filter_chain = Filter::FilesystemAccess.new(@fs, nil) instance_eval(&block) if block_given? end |
Instance Method Details
#auth ⇒ Object
21 22 23 |
# File 'lib/ftpmvc/application.rb', line 21 def auth @authenticator ||= Authenticator::Promiscuous.new end |
#handle_exception(e) ⇒ Object
25 26 27 28 |
# File 'lib/ftpmvc/application.rb', line 25 def handle_exception(e) logger.error %Q[#{e.class}: #{e.}\n#{e.backtrace.join("\n")}] @exception_handler.call(e) unless @exception_handler.nil? end |