Class: Spec::Performance::Client::Response
- Inherits:
-
Object
- Object
- Spec::Performance::Client::Response
- Defined in:
- lib/spec/performance/client/response.rb
Instance Attribute Summary collapse
-
#body ⇒ Object
readonly
Returns the value of attribute body.
-
#code ⇒ Object
readonly
Returns the value of attribute code.
-
#cookies ⇒ Object
readonly
Returns the value of attribute cookies.
Instance Method Summary collapse
-
#initialize(attributes = {}) ⇒ Response
constructor
A new instance of Response.
- #redirect? ⇒ Boolean
- #success? ⇒ Boolean
Constructor Details
#initialize(attributes = {}) ⇒ Response
Returns a new instance of Response.
9 10 11 12 |
# File 'lib/spec/performance/client/response.rb', line 9 def initialize(attributes = {}) @code = attributes[:code].to_i @body = attributes[:body] end |
Instance Attribute Details
#body ⇒ Object (readonly)
Returns the value of attribute body.
7 8 9 |
# File 'lib/spec/performance/client/response.rb', line 7 def body @body end |
#code ⇒ Object (readonly)
Returns the value of attribute code.
7 8 9 |
# File 'lib/spec/performance/client/response.rb', line 7 def code @code end |
#cookies ⇒ Object (readonly)
Returns the value of attribute cookies.
7 8 9 |
# File 'lib/spec/performance/client/response.rb', line 7 def @cookies end |
Instance Method Details
#redirect? ⇒ Boolean
18 19 20 |
# File 'lib/spec/performance/client/response.rb', line 18 def redirect? @code == 301 || @code == 302 end |
#success? ⇒ Boolean
14 15 16 |
# File 'lib/spec/performance/client/response.rb', line 14 def success? @code == 200 end |