Class: Factual::PlacesResponse
- Inherits:
-
Object
- Object
- Factual::PlacesResponse
- Defined in:
- lib/factual/places_response.rb
Instance Attribute Summary collapse
-
#body ⇒ Object
Returns the value of attribute body.
Instance Method Summary collapse
- #data ⇒ Object
- #error_message ⇒ Object
- #included_rows ⇒ Object
-
#initialize(response) ⇒ PlacesResponse
constructor
A new instance of PlacesResponse.
- #status ⇒ Object
- #success? ⇒ Boolean
- #total_rows ⇒ Object
- #version ⇒ Object
Constructor Details
#initialize(response) ⇒ PlacesResponse
Returns a new instance of PlacesResponse.
6 7 8 |
# File 'lib/factual/places_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/places_response.rb', line 4 def body @body end |
Instance Method Details
#data ⇒ Object
34 35 36 37 38 |
# File 'lib/factual/places_response.rb', line 34 def data if !@body.response.data.blank? @body.response.data end end |
#error_message ⇒ Object
22 23 24 |
# File 'lib/factual/places_response.rb', line 22 def # @body.message.text unless success? end |
#included_rows ⇒ Object
26 27 28 |
# File 'lib/factual/places_response.rb', line 26 def included_rows @body.included_rows end |
#status ⇒ Object
14 15 16 |
# File 'lib/factual/places_response.rb', line 14 def status @body.status end |
#success? ⇒ Boolean
18 19 20 |
# File 'lib/factual/places_response.rb', line 18 def success? @body.status == "ok" end |
#total_rows ⇒ Object
30 31 32 |
# File 'lib/factual/places_response.rb', line 30 def total_rows @body.total_row_count end |
#version ⇒ Object
10 11 12 |
# File 'lib/factual/places_response.rb', line 10 def version @body.version end |