Class: Richard::Request

Inherits:
Object
  • Object
show all
Defined in:
lib/richard_iii/request_and_response.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#bodyObject (readonly)

Returns the value of attribute body.



3
4
5
# File 'lib/richard_iii/request_and_response.rb', line 3

def body
  @body
end

#headersObject (readonly)

Returns the value of attribute headers.



3
4
5
# File 'lib/richard_iii/request_and_response.rb', line 3

def headers
  @headers
end

#uriObject (readonly)

Returns the value of attribute uri.



3
4
5
# File 'lib/richard_iii/request_and_response.rb', line 3

def uri
  @uri
end

#verbObject (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

Returns:

  • (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