Class: R43::Response
- Inherits:
-
Object
- Object
- R43::Response
- Defined in:
- lib/r43.rb
Instance Attribute Summary collapse
-
#cities ⇒ Object
readonly
Returns the value of attribute cities.
-
#city ⇒ Object
readonly
Returns the value of attribute city.
-
#entries ⇒ Object
readonly
Returns the value of attribute entries.
-
#entry ⇒ Object
readonly
Returns the value of attribute entry.
-
#goal ⇒ Object
readonly
Returns the value of attribute goal.
-
#goals ⇒ Object
readonly
Returns the value of attribute goals.
-
#has_object ⇒ Object
readonly
Returns the value of attribute has_object.
-
#max_in_page ⇒ Object
readonly
Returns the value of attribute max_in_page.
-
#next_offset ⇒ Object
readonly
Returns the value of attribute next_offset.
-
#object ⇒ Object
readonly
Returns the value of attribute object.
-
#objects ⇒ Object
readonly
Returns the value of attribute objects.
-
#people ⇒ Object
readonly
Returns the value of attribute people.
-
#person ⇒ Object
readonly
Returns the value of attribute person.
-
#query ⇒ Object
readonly
Returns the value of attribute query.
-
#service ⇒ Object
readonly
Returns the value of attribute service.
-
#tags ⇒ Object
readonly
Returns the value of attribute tags.
-
#title ⇒ Object
readonly
Returns the value of attribute title.
-
#total_available ⇒ Object
readonly
Returns the value of attribute total_available.
-
#xml ⇒ Object
readonly
Returns the value of attribute xml.
Instance Method Summary collapse
-
#initialize(service, query) ⇒ Response
constructor
This is only meant to be called by a R43::Connection object.
-
#more ⇒ Object
When a response hase been paged, the more method provides a simple mechanism for getting additional entries.
Constructor Details
#initialize(service, query) ⇒ Response
This is only meant to be called by a R43::Connection object.
97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 |
# File 'lib/r43.rb', line 97 def initialize(service, query) @service = service @query = query @has_object = false @objects = [] @entries = [] @people = [] @goals = [] @cities = [] @tags = [] @title = "" @max_in_page = 0 @total_available = 0 @next_offset = 0 _from_xml(service.get_response(query)) end |
Instance Attribute Details
#cities ⇒ Object (readonly)
Returns the value of attribute cities.
89 90 91 |
# File 'lib/r43.rb', line 89 def cities @cities end |
#city ⇒ Object
Returns the value of attribute city.
89 90 91 |
# File 'lib/r43.rb', line 89 def city @city end |
#entries ⇒ Object (readonly)
Returns the value of attribute entries.
89 90 91 |
# File 'lib/r43.rb', line 89 def entries @entries end |
#entry ⇒ Object
Returns the value of attribute entry.
89 90 91 |
# File 'lib/r43.rb', line 89 def entry @entry end |
#goal ⇒ Object
Returns the value of attribute goal.
89 90 91 |
# File 'lib/r43.rb', line 89 def goal @goal end |
#goals ⇒ Object (readonly)
Returns the value of attribute goals.
89 90 91 |
# File 'lib/r43.rb', line 89 def goals @goals end |
#has_object ⇒ Object (readonly)
Returns the value of attribute has_object.
89 90 91 |
# File 'lib/r43.rb', line 89 def has_object @has_object end |
#max_in_page ⇒ Object (readonly)
Returns the value of attribute max_in_page.
89 90 91 |
# File 'lib/r43.rb', line 89 def max_in_page @max_in_page end |
#next_offset ⇒ Object (readonly)
Returns the value of attribute next_offset.
89 90 91 |
# File 'lib/r43.rb', line 89 def next_offset @next_offset end |
#object ⇒ Object
Returns the value of attribute object.
89 90 91 |
# File 'lib/r43.rb', line 89 def object @object end |
#objects ⇒ Object (readonly)
Returns the value of attribute objects.
89 90 91 |
# File 'lib/r43.rb', line 89 def objects @objects end |
#people ⇒ Object (readonly)
Returns the value of attribute people.
89 90 91 |
# File 'lib/r43.rb', line 89 def people @people end |
#person ⇒ Object
Returns the value of attribute person.
89 90 91 |
# File 'lib/r43.rb', line 89 def person @person end |
#query ⇒ Object (readonly)
Returns the value of attribute query.
89 90 91 |
# File 'lib/r43.rb', line 89 def query @query end |
#service ⇒ Object (readonly)
Returns the value of attribute service.
89 90 91 |
# File 'lib/r43.rb', line 89 def service @service end |
#tags ⇒ Object (readonly)
Returns the value of attribute tags.
89 90 91 |
# File 'lib/r43.rb', line 89 def @tags end |
#title ⇒ Object
Returns the value of attribute title.
89 90 91 |
# File 'lib/r43.rb', line 89 def title @title end |
#total_available ⇒ Object (readonly)
Returns the value of attribute total_available.
89 90 91 |
# File 'lib/r43.rb', line 89 def total_available @total_available end |
#xml ⇒ Object (readonly)
Returns the value of attribute xml.
89 90 91 |
# File 'lib/r43.rb', line 89 def xml @xml end |
Instance Method Details
#more ⇒ Object
When a response hase been paged, the more method provides a simple mechanism for getting additional entries.
require 'r43'
connection = R43::Connection.new(<api_key>)
people = connection.get_goals_people(<goal_id>)
people += connection.more
123 124 125 126 |
# File 'lib/r43.rb', line 123 def more() clear_arrays() _populate_collections_from_xml(service.get_response(query + "&offset=#{@next_offset}")) end |