Class: Lotus::Welcome

Inherits:
Object
  • Object
show all
Defined in:
lib/lotus/welcome.rb

Overview

Since:

  • 0.1.0

Instance Method Summary collapse

Constructor Details

#initialize(app) ⇒ Welcome

Returns a new instance of Welcome.

Since:

  • 0.1.0



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_nameObject

Since:

  • 0.1.0



19
20
21
# File 'lib/lotus/welcome.rb', line 19

def application_name
  " #{ app }" if container?
end

#call(env) ⇒ Object

Since:

  • 0.1.0



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