Class: Scalar::UI

Inherits:
Object
  • Object
show all
Defined in:
lib/scalar/ui.rb

Class Method Summary collapse

Class Method Details

.call(_env) ⇒ Object



8
9
10
11
12
13
14
# File 'lib/scalar/ui.rb', line 8

def self.call(_env)
  [
    200,
    { 'Content-Type' => 'text/html; charset=utf-8' },
    [template.result_with_hash(config: Scalar::Config.instance)]
  ]
end

.templateObject



16
17
18
# File 'lib/scalar/ui.rb', line 16

def self.template
  ERB.new(File.read("#{Scalar::LIB_PATH}/scalar/template.erb"))
end