Class: VCR::ResponseStatus
- Inherits:
-
Struct
- Object
- Struct
- VCR::ResponseStatus
- Defined in:
- lib/vcr/structs.rb
Overview
The response status of an HTTPInteraction.
Instance Attribute Summary collapse
-
#code ⇒ Integer
the HTTP status code.
-
#message ⇒ String
the HTTP status message (e.g. "OK" for a status of 200).
Class Method Summary collapse
-
.from_hash(hash) ⇒ ResponseStatus
Constructs a new instance from a hash.
Instance Method Summary collapse
-
#to_hash ⇒ Hash
Builds a serializable hash from the response status data.
Instance Attribute Details
#code ⇒ Integer
the HTTP status code
412 413 414 |
# File 'lib/vcr/structs.rb', line 412 def code @code end |
#message ⇒ String
the HTTP status message (e.g. "OK" for a status of 200)
412 413 414 |
# File 'lib/vcr/structs.rb', line 412 def @message end |
Class Method Details
.from_hash(hash) ⇒ ResponseStatus
Constructs a new instance from a hash.
428 429 430 |
# File 'lib/vcr/structs.rb', line 428 def self.from_hash(hash) new hash['code'], hash['message'] end |
Instance Method Details
#to_hash ⇒ Hash
Builds a serializable hash from the response status data.
418 419 420 421 422 |
# File 'lib/vcr/structs.rb', line 418 def to_hash { 'code' => code, 'message' => }.tap { |h| OrderedHashSerializer.apply_to(h, members) } end |