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



74
75
76
# File 'lib/draw_uml/engine.rb', line 74

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

.prototypeObject



70
71
72
# File 'lib/draw_uml/engine.rb', line 70

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