Class: Rack::EncodingGuard::Middleware
- Inherits:
-
Object
- Object
- Rack::EncodingGuard::Middleware
- Defined in:
- lib/rack/encoding_guard/middleware.rb
Instance Attribute Summary collapse
-
#app ⇒ Object
readonly
Returns the value of attribute app.
-
#strategy ⇒ Object
readonly
Returns the value of attribute strategy.
Instance Method Summary collapse
- #call(env) ⇒ Object
-
#initialize(app, strategy = nil, options = {}) ⇒ Middleware
constructor
A new instance of Middleware.
Constructor Details
#initialize(app, strategy = nil, options = {}) ⇒ Middleware
Returns a new instance of Middleware.
6 7 8 9 |
# File 'lib/rack/encoding_guard/middleware.rb', line 6 def initialize(app, strategy = nil, = {}) @app = app @strategy = resolve_strategy_object(strategy, ) end |
Instance Attribute Details
#app ⇒ Object (readonly)
Returns the value of attribute app.
4 5 6 |
# File 'lib/rack/encoding_guard/middleware.rb', line 4 def app @app end |
#strategy ⇒ Object (readonly)
Returns the value of attribute strategy.
4 5 6 |
# File 'lib/rack/encoding_guard/middleware.rb', line 4 def strategy @strategy end |
Instance Method Details
#call(env) ⇒ Object
11 12 13 14 15 |
# File 'lib/rack/encoding_guard/middleware.rb', line 11 def call(env) strategy.process(env) do app.call(env) end end |