Class: Avocado::Request
- Inherits:
-
Object
- Object
- Avocado::Request
- Includes:
- ActiveModel::Model
- Defined in:
- app/models/avocado/request.rb
Instance Attribute Summary collapse
-
#body ⇒ Object
Returns the value of attribute body.
-
#description ⇒ Object
Returns the value of attribute description.
-
#endpoint ⇒ Object
Returns the value of attribute endpoint.
-
#headers ⇒ Object
Returns the value of attribute headers.
-
#params ⇒ Object
Returns the value of attribute params.
-
#path ⇒ Object
Returns the value of attribute path.
-
#status ⇒ Object
Returns the value of attribute status.
-
#uid ⇒ Object
Returns the value of attribute uid.
-
#url ⇒ Object
Returns the value of attribute url.
Instance Method Summary collapse
- #<=>(other) ⇒ Object
- #==(other) ⇒ Object
-
#initialize ⇒ Request
constructor
A new instance of Request.
- #unique?(requests) ⇒ Boolean
Constructor Details
#initialize ⇒ Request
Returns a new instance of Request.
8 9 10 11 |
# File 'app/models/avocado/request.rb', line 8 def initialize(*) super self.uid = SecureRandom.hex end |
Instance Attribute Details
#body ⇒ Object
Returns the value of attribute body.
5 6 7 |
# File 'app/models/avocado/request.rb', line 5 def body @body end |
#description ⇒ Object
Returns the value of attribute description.
6 7 8 |
# File 'app/models/avocado/request.rb', line 6 def description @description end |
#endpoint ⇒ Object
Returns the value of attribute endpoint.
6 7 8 |
# File 'app/models/avocado/request.rb', line 6 def endpoint @endpoint end |
#headers ⇒ Object
Returns the value of attribute headers.
5 6 7 |
# File 'app/models/avocado/request.rb', line 5 def headers @headers end |
#params ⇒ Object
Returns the value of attribute params.
5 6 7 |
# File 'app/models/avocado/request.rb', line 5 def params @params end |
#path ⇒ Object
Returns the value of attribute path.
5 6 7 |
# File 'app/models/avocado/request.rb', line 5 def path @path end |
#status ⇒ Object
Returns the value of attribute status.
5 6 7 |
# File 'app/models/avocado/request.rb', line 5 def status @status end |
#uid ⇒ Object
Returns the value of attribute uid.
5 6 7 |
# File 'app/models/avocado/request.rb', line 5 def uid @uid end |
#url ⇒ Object
Returns the value of attribute url.
5 6 7 |
# File 'app/models/avocado/request.rb', line 5 def url @url end |
Instance Method Details
#<=>(other) ⇒ Object
20 21 22 |
# File 'app/models/avocado/request.rb', line 20 def <=>(other) status <=> other.status end |
#==(other) ⇒ Object
13 14 15 16 17 18 |
# File 'app/models/avocado/request.rb', line 13 def ==(other) other.path == path && other.params == params && other.status == status && other.body == body end |
#unique?(requests) ⇒ Boolean
24 25 26 |
# File 'app/models/avocado/request.rb', line 24 def unique?(requests) requests.none? { |req| self == req } end |