Class: Theme::Middleware

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(app) ⇒ Middleware

Returns a new instance of Middleware.



8
9
10
# File 'lib/theme/middleware.rb', line 8

def initialize(app)
  @app = app
end

Instance Attribute Details

#appObject (readonly)

Returns the value of attribute app.



6
7
8
# File 'lib/theme/middleware.rb', line 6

def app
  @app
end

#envObject (readonly)

Returns the value of attribute env.



6
7
8
# File 'lib/theme/middleware.rb', line 6

def env
  @env
end

Instance Method Details

#call(env) ⇒ Object



12
13
14
# File 'lib/theme/middleware.rb', line 12

def call env
  dup.call! env
end

#call!(env) ⇒ Object



16
17
18
19
20
21
22
23
24
# File 'lib/theme/middleware.rb', line 16

def call! env
  @env = env

  if component_path
    render_component
  else
    res
  end
end