Class: ActiveResource::Request
- Defined in:
- activeresource/lib/active_resource/http_mock.rb
Instance Attribute Summary collapse
-
#body ⇒ Object
Returns the value of attribute body.
-
#headers ⇒ Object
Returns the value of attribute headers.
-
#method ⇒ Object
Returns the value of attribute method.
-
#path ⇒ Object
Returns the value of attribute path.
Instance Method Summary collapse
- #==(req) ⇒ Object
-
#initialize(method, path, body = nil, headers = {}) ⇒ Request
constructor
A new instance of Request.
- #to_s ⇒ Object
Constructor Details
#initialize(method, path, body = nil, headers = {}) ⇒ Request
Returns a new instance of Request.
258 259 260 |
# File 'activeresource/lib/active_resource/http_mock.rb', line 258 def initialize(method, path, body = nil, headers = {}) @method, @path, @body, @headers = method, path, body, headers end |
Instance Attribute Details
#body ⇒ Object
Returns the value of attribute body
256 257 258 |
# File 'activeresource/lib/active_resource/http_mock.rb', line 256 def body @body end |
#headers ⇒ Object
Returns the value of attribute headers
256 257 258 |
# File 'activeresource/lib/active_resource/http_mock.rb', line 256 def headers @headers end |
#method ⇒ Object
Returns the value of attribute method
256 257 258 |
# File 'activeresource/lib/active_resource/http_mock.rb', line 256 def method @method end |
#path ⇒ Object
Returns the value of attribute path
256 257 258 |
# File 'activeresource/lib/active_resource/http_mock.rb', line 256 def path @path end |
Instance Method Details
#==(req) ⇒ Object
262 263 264 |
# File 'activeresource/lib/active_resource/http_mock.rb', line 262 def ==(req) path == req.path && method == req.method && headers_match?(req) end |
#to_s ⇒ Object
266 267 268 |
# File 'activeresource/lib/active_resource/http_mock.rb', line 266 def to_s "<#{method.to_s.upcase}: #{path} [#{headers}] (#{body})>" end |