Class: Theme::Assets::Middleware

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(app) ⇒ Middleware

Returns a new instance of Middleware.



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

def initialize(app)
  @app = app
end

Instance Attribute Details

#appObject (readonly)

Returns the value of attribute app.



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

def app
  @app
end

#envObject (readonly)

Returns the value of attribute env.



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

def env
  @env
end

Instance Method Details

#call(env) ⇒ Object



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

def call env
  dup.call! env
end

#call!(env) ⇒ Object



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

def call! env
  @env = env

  if assets_path
    render_assets
  else
    res
  end
end