Class: Factual::CoreResponse
- Inherits:
-
Object
- Object
- Factual::CoreResponse
- Defined in:
- lib/factual/core_response.rb
Instance Attribute Summary collapse
-
#body ⇒ Object
Returns the value of attribute body.
Instance Method Summary collapse
- #error_message ⇒ Object
-
#initialize(response) ⇒ CoreResponse
constructor
A new instance of CoreResponse.
- #schema ⇒ Object
- #status ⇒ Object
- #success? ⇒ Boolean
- #version ⇒ Object
Constructor Details
#initialize(response) ⇒ CoreResponse
Returns a new instance of CoreResponse.
6 7 8 |
# File 'lib/factual/core_response.rb', line 6 def initialize(response) @body = rash_response(response) end |
Instance Attribute Details
#body ⇒ Object
Returns the value of attribute body.
4 5 6 |
# File 'lib/factual/core_response.rb', line 4 def body @body end |
Instance Method Details
#error_message ⇒ Object
22 23 24 |
# File 'lib/factual/core_response.rb', line 22 def # @body.message.text unless success? end |
#schema ⇒ Object
26 27 28 29 30 |
# File 'lib/factual/core_response.rb', line 26 def schema if !@body.response.view.blank? @body.response.view end end |
#status ⇒ Object
14 15 16 |
# File 'lib/factual/core_response.rb', line 14 def status @body.status end |
#success? ⇒ Boolean
18 19 20 |
# File 'lib/factual/core_response.rb', line 18 def success? @body.status == "ok" end |
#version ⇒ Object
10 11 12 |
# File 'lib/factual/core_response.rb', line 10 def version @body.version end |