Class: Rack::LDP::Requests
- Inherits:
-
Object
- Object
- Rack::LDP::Requests
- Defined in:
- lib/rack/ldp.rb
Instance Method Summary collapse
-
#call(env) ⇒ Array
Handles a Rack protocol request.
-
#initialize(app) ⇒ Requests
constructor
A new instance of Requests.
Constructor Details
#initialize(app) ⇒ Requests
Returns a new instance of Requests.
92 93 94 |
# File 'lib/rack/ldp.rb', line 92 def initialize(app) @app = app end |
Instance Method Details
#call(env) ⇒ Array
Handles a Rack protocol request. Sends appropriate request to the object, alters response accordingly.
102 103 104 105 106 107 108 109 |
# File 'lib/rack/ldp.rb', line 102 def call(env) status, headers, response = @app.call(env) return [status, headers, response] unless response.is_a? RDF::LDP::Resource response .send(:request, env['REQUEST_METHOD'].to_sym, status, headers, env) end |