Class: Forward::Static::App
- Inherits:
-
Object
- Object
- Forward::Static::App
- Defined in:
- lib/forward/static/app.rb
Instance Attribute Summary collapse
-
#files ⇒ Object
readonly
Returns the value of attribute files.
-
#path ⇒ Object
Returns the value of attribute path.
-
#root ⇒ Object
Returns the value of attribute root.
Instance Method Summary collapse
- #_call(env) ⇒ Object
- #call(env) ⇒ Object
-
#initialize(root, app = nil) ⇒ App
constructor
A new instance of App.
Constructor Details
Instance Attribute Details
#files ⇒ Object (readonly)
Returns the value of attribute files.
78 79 80 |
# File 'lib/forward/static/app.rb', line 78 def files @files end |
#path ⇒ Object
Returns the value of attribute path.
80 81 82 |
# File 'lib/forward/static/app.rb', line 80 def path @path end |
#root ⇒ Object
Returns the value of attribute root.
79 80 81 |
# File 'lib/forward/static/app.rb', line 79 def root @root end |
Instance Method Details
#_call(env) ⇒ Object
92 93 94 95 96 97 98 99 100 101 102 |
# File 'lib/forward/static/app.rb', line 92 def _call(env) @env = env @path_info = Rack::Utils.unescape(env['PATH_INFO']) if forbidden? render_404 else @path = File.join(@root, @path_info) process end end |
#call(env) ⇒ Object
88 89 90 |
# File 'lib/forward/static/app.rb', line 88 def call(env) dup._call(env) end |