Class: DrawUml::Engine

Inherits:
Object
  • Object
show all
Defined in:
lib/draw_uml/engine.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#requestObject

Returns the value of attribute request.



6
7
8
# File 'lib/draw_uml/engine.rb', line 6

def request
  @request
end

#treeObject

Returns the value of attribute tree.



6
7
8
# File 'lib/draw_uml/engine.rb', line 6

def tree
  @tree
end

Class Method Details

.call(env) ⇒ Object



72
73
74
# File 'lib/draw_uml/engine.rb', line 72

def call(env)
  prototype.call(env)
end

.prototypeObject



68
69
70
# File 'lib/draw_uml/engine.rb', line 68

def prototype
  @prototype ||= new
end

Instance Method Details

#call(env) ⇒ Object



8
9
10
11
12
13
14
15
16
17
# File 'lib/draw_uml/engine.rb', line 8

def call(env)
  @request = Rack::Request.new(env)
  @tree = DrawUml::Tree.create(DrawUml::Configure.source_path)

  status = 200
  headers = {'Content-Type' => 'text/html'}
  body = ERB.new(DrawUml::Configure.application_template).result(binding)

  [status, headers, [body]]
end