Class: Uuml::Middleware

Inherits:
Object
  • Object
show all
Defined in:
lib/uuml/middleware.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(app) ⇒ Middleware

Returns a new instance of Middleware.



7
8
9
# File 'lib/uuml/middleware.rb', line 7

def initialize(app)
  @app = app
end

Instance Attribute Details

#appObject (readonly)

Returns the value of attribute app.



5
6
7
# File 'lib/uuml/middleware.rb', line 5

def app
  @app
end

Instance Method Details

#call(env) ⇒ Object



11
12
13
14
15
16
17
18
# File 'lib/uuml/middleware.rb', line 11

def call(env)
  status, headers, response = @app.call(env)
  
  if headers['Content-Type'] == 'text/html; charset=utf-8'
    response.body = Uuml::HTML.convert(response.body)
  end
  [status, headers, response]
end