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.
14 15 16 17 18 |
# File 'lib/ftpmvc/application.rb', line 14 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
20 21 22 |
# File 'lib/ftpmvc/application.rb', line 20 def auth @authenticator ||= Authenticator::Promiscuous.new end |
#handle_exception(e) ⇒ Object
24 25 26 27 |
# File 'lib/ftpmvc/application.rb', line 24 def handle_exception(e) logger.error %Q[#{e.class}: #{e.}\n#{e.backtrace.join("\n")}] @exception_handler.call(e) unless @exception_handler.nil? end |