Class: Abqari::HttpSafe::Response
- Inherits:
-
Struct
- Object
- Struct
- Abqari::HttpSafe::Response
- Defined in:
- lib/abqari/http_safe.rb
Instance Attribute Summary collapse
-
#body ⇒ Object
Returns the value of attribute body.
-
#code ⇒ Object
Returns the value of attribute code.
-
#headers ⇒ Object
Returns the value of attribute headers.
-
#message ⇒ Object
Returns the value of attribute message.
Instance Method Summary collapse
-
#[](name) ⇒ Object
Case-insensitive header lookup — matches Net::HTTPResponse#[] semantics so call sites don't have to remember which casing the server returned.
- #success? ⇒ Boolean
Instance Attribute Details
#body ⇒ Object
Returns the value of attribute body
32 33 34 |
# File 'lib/abqari/http_safe.rb', line 32 def body @body end |
#code ⇒ Object
Returns the value of attribute code
32 33 34 |
# File 'lib/abqari/http_safe.rb', line 32 def code @code end |
#headers ⇒ Object
Returns the value of attribute headers
32 33 34 |
# File 'lib/abqari/http_safe.rb', line 32 def headers @headers end |
#message ⇒ Object
Returns the value of attribute message
32 33 34 |
# File 'lib/abqari/http_safe.rb', line 32 def @message end |
Instance Method Details
#[](name) ⇒ Object
Case-insensitive header lookup — matches Net::HTTPResponse#[] semantics so call sites don't have to remember which casing the server returned.
35 36 37 |
# File 'lib/abqari/http_safe.rb', line 35 def [](name) headers[name.to_s.downcase] end |
#success? ⇒ Boolean
39 40 41 |
# File 'lib/abqari/http_safe.rb', line 39 def success? code.to_i.between?(200, 299) end |