Class: Dommy::Resources::Response
- Inherits:
-
Struct
- Object
- Struct
- Dommy::Resources::Response
- Defined in:
- lib/dommy/resources.rb
Overview
A resolved resource. status_text is filled by whichever adapter built
it (the Rack adapter uses Rack::Utils; the core adapters leave it blank or
derive a minimal default) so the core stays Rails/Rack-independent.
Instance Attribute Summary collapse
-
#body ⇒ Object
Returns the value of attribute body.
-
#headers ⇒ Object
Returns the value of attribute headers.
-
#redirected ⇒ Object
Returns the value of attribute redirected.
-
#status ⇒ Object
Returns the value of attribute status.
-
#status_text ⇒ Object
Returns the value of attribute status_text.
-
#url ⇒ Object
Returns the value of attribute url.
Instance Method Summary collapse
Instance Attribute Details
#body ⇒ Object
Returns the value of attribute body
20 21 22 |
# File 'lib/dommy/resources.rb', line 20 def body @body end |
#headers ⇒ Object
Returns the value of attribute headers
20 21 22 |
# File 'lib/dommy/resources.rb', line 20 def headers @headers end |
#redirected ⇒ Object
Returns the value of attribute redirected
20 21 22 |
# File 'lib/dommy/resources.rb', line 20 def redirected @redirected end |
#status ⇒ Object
Returns the value of attribute status
20 21 22 |
# File 'lib/dommy/resources.rb', line 20 def status @status end |
#status_text ⇒ Object
Returns the value of attribute status_text
20 21 22 |
# File 'lib/dommy/resources.rb', line 20 def status_text @status_text end |
#url ⇒ Object
Returns the value of attribute url
20 21 22 |
# File 'lib/dommy/resources.rb', line 20 def url @url end |
Instance Method Details
#success? ⇒ Boolean
21 |
# File 'lib/dommy/resources.rb', line 21 def success? = (200..299).cover?(status.to_i) |