Class: Lotus::Welcome
- Inherits:
-
Object
- Object
- Lotus::Welcome
- Defined in:
- lib/lotus/welcome.rb
Overview
Instance Method Summary collapse
- #application_name ⇒ Object
- #call(env) ⇒ Object
-
#initialize(app) ⇒ Welcome
constructor
A new instance of Welcome.
Constructor Details
#initialize(app) ⇒ Welcome
Returns a new instance of Welcome.
8 9 10 |
# File 'lib/lotus/welcome.rb', line 8 def initialize(app) @root = Pathname.new(__dir__).join('templates').realpath end |
Instance Method Details
#application_name ⇒ Object
19 20 21 |
# File 'lib/lotus/welcome.rb', line 19 def application_name " #{ app }" if container? end |
#call(env) ⇒ Object
12 13 14 15 16 17 |
# File 'lib/lotus/welcome.rb', line 12 def call(env) @request_path = env['REQUEST_PATH'] || '' @body = [ERB.new(@root.join('welcome.html.erb').read).result(binding)] [200, {}, @body] end |