Class: Hanami::Welcome Private
- Inherits:
-
Object
- Object
- Hanami::Welcome
- Defined in:
- lib/hanami/welcome.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.
Instance Method Summary collapse
- #application_name ⇒ Object private
- #call(env) ⇒ Object private
-
#initialize(_app) ⇒ Welcome
constructor
private
A new instance of Welcome.
Constructor Details
#initialize(_app) ⇒ Welcome
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 Welcome.
10 11 12 |
# File 'lib/hanami/welcome.rb', line 10 def initialize(_app) @root = Pathname.new(__dir__).join('templates').realpath end |
Instance Method Details
#application_name ⇒ 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 |
# File 'lib/hanami/welcome.rb', line 24 def application_name application_class.app_name end |
#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.
15 16 17 18 19 20 21 |
# File 'lib/hanami/welcome.rb', line 15 def call(env) @request_path = env['REQUEST_PATH'] || '' @request_host = env['HTTP_HOST'] || '' @body = [ERB.new(@root.join('welcome.html.erb').read).result(binding)] [200, {}, @body] end |