Class: Lotus::Action::Rack::File Private
- Inherits:
-
Object
- Object
- Lotus::Action::Rack::File
- Defined in:
- lib/lotus/action/rack/file.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
File to be sent
Instance Method Summary collapse
- #call(env) ⇒ Object private
-
#initialize(path) ⇒ File
constructor
private
A new instance of File.
Constructor Details
#initialize(path) ⇒ File
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of File.
17 18 19 20 |
# File 'lib/lotus/action/rack/file.rb', line 17 def initialize(path) @file = ::Rack::File.new(nil) @path = path end |
Instance Method Details
#call(env) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
24 25 26 27 28 29 |
# File 'lib/lotus/action/rack/file.rb', line 24 def call(env) @file.path = @path.to_s @file.serving(env) rescue Errno::ENOENT [404, {}, nil] end |