Class: Roby::Interface::REST::Server::RackMiddleware Private
- Defined in:
- lib/roby/interface/rest/server.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Intermediate Rack middleware used to inject the roby storage and interface objects that allow Helpers to function
Instance Attribute Summary collapse
- #interface ⇒ Object readonly private
- #storage ⇒ Object readonly private
Instance Method Summary collapse
- #call(env) ⇒ Object private
-
#initialize(api, interface, storage = {}, roby_execute: true) ⇒ RackMiddleware
constructor
private
A new instance of RackMiddleware.
Constructor Details
#initialize(api, interface, storage = {}, roby_execute: true) ⇒ RackMiddleware
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of RackMiddleware.
90 91 92 93 94 95 |
# File 'lib/roby/interface/rest/server.rb', line 90 def initialize(api, interface, storage = {}, roby_execute: true) @api = api @interface = interface @storage = storage @roby_execute = roby_execute end |
Instance Attribute Details
#interface ⇒ Object (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
88 89 90 |
# File 'lib/roby/interface/rest/server.rb', line 88 def interface @interface end |
#storage ⇒ Object (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
88 89 90 |
# File 'lib/roby/interface/rest/server.rb', line 88 def storage @storage end |
Instance Method Details
#call(env) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
97 98 99 100 101 102 103 104 105 106 107 108 |
# File 'lib/roby/interface/rest/server.rb', line 97 def call(env) env["roby.interface"] = interface env["roby.storage"] = storage if @roby_execute interface.app.execution_engine.execute do @api.call(env) end else @api.call(env) end end |