Class: VaultedBilling::HTTP::Response
- Inherits:
-
Object
- Object
- VaultedBilling::HTTP::Response
- Defined in:
- lib/vaulted_billing/http.rb
Instance Attribute Summary collapse
-
#body ⇒ Object
Returns the value of attribute body.
-
#code ⇒ Object
(also: #status_code)
Returns the value of attribute code.
-
#connection_error ⇒ Object
(also: #connection_error?)
Returns the value of attribute connection_error.
-
#message ⇒ Object
Returns the value of attribute message.
-
#raw_response ⇒ Object
Returns the value of attribute raw_response.
-
#success ⇒ Object
(also: #success?)
Returns the value of attribute success.
Instance Method Summary collapse
-
#initialize(http_response) ⇒ Response
constructor
A new instance of Response.
Constructor Details
#initialize(http_response) ⇒ Response
Returns a new instance of Response.
29 30 31 32 33 34 35 36 37 38 |
# File 'lib/vaulted_billing/http.rb', line 29 def initialize(http_response) if http_response self.raw_response = http_response self.code = http_response.code self. = http_response. self.body = http_response.body self.success = ((http_response.code =~ /^2\d{2}/) == 0) self.connection_error = false end end |
Instance Attribute Details
#body ⇒ Object
Returns the value of attribute body.
23 24 25 |
# File 'lib/vaulted_billing/http.rb', line 23 def body @body end |
#code ⇒ Object Also known as: status_code
Returns the value of attribute code.
21 22 23 |
# File 'lib/vaulted_billing/http.rb', line 21 def code @code end |
#connection_error ⇒ Object Also known as: connection_error?
Returns the value of attribute connection_error.
26 27 28 |
# File 'lib/vaulted_billing/http.rb', line 26 def connection_error @connection_error end |
#message ⇒ Object
Returns the value of attribute message.
22 23 24 |
# File 'lib/vaulted_billing/http.rb', line 22 def @message end |
#raw_response ⇒ Object
Returns the value of attribute raw_response.
25 26 27 |
# File 'lib/vaulted_billing/http.rb', line 25 def raw_response @raw_response end |
#success ⇒ Object Also known as: success?
Returns the value of attribute success.
24 25 26 |
# File 'lib/vaulted_billing/http.rb', line 24 def success @success end |