Class: ActiveResource::Request
- Inherits:
-
Object
- Object
- ActiveResource::Request
- Defined in:
- activeresource/lib/active_resource/http_mock.rb
Instance Attribute Summary (collapse)
-
- (Object) body
Returns the value of attribute body.
-
- (Object) headers
Returns the value of attribute headers.
-
- (Object) method
Returns the value of attribute method.
-
- (Object) path
Returns the value of attribute path.
Instance Method Summary (collapse)
- - (Object) ==(req)
-
- (Request) initialize(method, path, body = nil, headers = {})
constructor
A new instance of Request.
- - (Object) to_s
Constructor Details
- (Request) initialize(method, path, body = nil, headers = {})
A new instance of Request
228 229 230 |
# File 'activeresource/lib/active_resource/http_mock.rb', line 228 def initialize(method, path, body = nil, headers = {}) @method, @path, @body, @headers = method, path, body, headers end |
Instance Attribute Details
- (Object) body
Returns the value of attribute body
226 227 228 |
# File 'activeresource/lib/active_resource/http_mock.rb', line 226 def body @body end |
- (Object) headers
Returns the value of attribute headers
226 227 228 |
# File 'activeresource/lib/active_resource/http_mock.rb', line 226 def headers @headers end |
- (Object) method
Returns the value of attribute method
226 227 228 |
# File 'activeresource/lib/active_resource/http_mock.rb', line 226 def method @method end |
- (Object) path
Returns the value of attribute path
226 227 228 |
# File 'activeresource/lib/active_resource/http_mock.rb', line 226 def path @path end |
Instance Method Details
- (Object) ==(req)
232 233 234 |
# File 'activeresource/lib/active_resource/http_mock.rb', line 232 def ==(req) path == req.path && method == req.method && headers_match?(req) end |
- (Object) to_s
236 237 238 |
# File 'activeresource/lib/active_resource/http_mock.rb', line 236 def to_s "<#{method.to_s.upcase}: #{path} [#{headers}] (#{body})>" end |