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
11
# File 'lib/lotus/welcome.rb', line 8

def initialize(app)
  @root = Pathname.new(__dir__).join('templates').realpath
  @body = [ERB.new(@root.join('welcome.html.erb').read).result(binding)]
end

Instance Method Details

#application_nameObject

Since:

  • 0.1.0



17
18
19
# File 'lib/lotus/welcome.rb', line 17

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

#call(env) ⇒ Object

Since:

  • 0.1.0



13
14
15
# File 'lib/lotus/welcome.rb', line 13

def call(env)
  [200, {}, @body]
end