Class: Richard::Request
- Inherits:
-
Object
- Object
- Richard::Request
- Defined in:
- lib/richard_iii/request_and_response.rb
Instance Attribute Summary collapse
-
#body ⇒ Object
readonly
Returns the value of attribute body.
-
#headers ⇒ Object
readonly
Returns the value of attribute headers.
-
#uri ⇒ Object
readonly
Returns the value of attribute uri.
-
#verb ⇒ Object
readonly
Returns the value of attribute verb.
Instance Method Summary collapse
- #eql?(other) ⇒ Boolean
-
#initialize(opts = {}) ⇒ Request
constructor
A new instance of Request.
Constructor Details
#initialize(opts = {}) ⇒ Request
Returns a new instance of Request.
5 6 7 |
# File 'lib/richard_iii/request_and_response.rb', line 5 def initialize(opts={}) @verb,@uri,@headers,@body = opts[:verb],opts[:uri],opts[:headers],opts[:body] end |
Instance Attribute Details
#body ⇒ Object (readonly)
Returns the value of attribute body.
3 4 5 |
# File 'lib/richard_iii/request_and_response.rb', line 3 def body @body end |
#headers ⇒ Object (readonly)
Returns the value of attribute headers.
3 4 5 |
# File 'lib/richard_iii/request_and_response.rb', line 3 def headers @headers end |
#uri ⇒ Object (readonly)
Returns the value of attribute uri.
3 4 5 |
# File 'lib/richard_iii/request_and_response.rb', line 3 def uri @uri end |
#verb ⇒ Object (readonly)
Returns the value of attribute verb.
3 4 5 |
# File 'lib/richard_iii/request_and_response.rb', line 3 def verb @verb end |
Instance Method Details
#eql?(other) ⇒ Boolean
9 10 11 |
# File 'lib/richard_iii/request_and_response.rb', line 9 def eql?(other) self.verb.eql?(other.verb) && self.uri.eql?(other.uri) && self.headers == other.headers && self.body.eql?(other.body) end |