Class: R43::Response

Inherits:
Object
  • Object
show all
Defined in:
lib/r43.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(service, query) ⇒ Response

Returns a new instance of Response.



509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
# File 'lib/r43.rb', line 509

def initialize(service, query)
  @service = service
  @query = query
  @has_object = false
  @objects = []
  @entries = []
  @people = []
  @goals = []
  @cities = []
  @tags = []
  @max_in_page = 0
  @total_available = 0
  @next_offset = 0
  _from_xml(service.get_response(query))
end

Instance Attribute Details

#citiesObject (readonly)

Returns the value of attribute cities.



504
505
506
# File 'lib/r43.rb', line 504

def cities
  @cities
end

#cityObject

Returns the value of attribute city.



504
505
506
# File 'lib/r43.rb', line 504

def city
  @city
end

#entriesObject (readonly)

Returns the value of attribute entries.



504
505
506
# File 'lib/r43.rb', line 504

def entries
  @entries
end

#entryObject

Returns the value of attribute entry.



504
505
506
# File 'lib/r43.rb', line 504

def entry
  @entry
end

#goalObject

Returns the value of attribute goal.



504
505
506
# File 'lib/r43.rb', line 504

def goal
  @goal
end

#goalsObject (readonly)

Returns the value of attribute goals.



504
505
506
# File 'lib/r43.rb', line 504

def goals
  @goals
end

#has_objectObject (readonly)

Returns the value of attribute has_object.



504
505
506
# File 'lib/r43.rb', line 504

def has_object
  @has_object
end

#max_in_pageObject (readonly)

Returns the value of attribute max_in_page.



504
505
506
# File 'lib/r43.rb', line 504

def max_in_page
  @max_in_page
end

#next_offsetObject (readonly)

Returns the value of attribute next_offset.



504
505
506
# File 'lib/r43.rb', line 504

def next_offset
  @next_offset
end

#objectObject

Returns the value of attribute object.



504
505
506
# File 'lib/r43.rb', line 504

def object
  @object
end

#objectsObject (readonly)

Returns the value of attribute objects.



504
505
506
# File 'lib/r43.rb', line 504

def objects
  @objects
end

#peopleObject (readonly)

Returns the value of attribute people.



504
505
506
# File 'lib/r43.rb', line 504

def people
  @people
end

#personObject

Returns the value of attribute person.



504
505
506
# File 'lib/r43.rb', line 504

def person
  @person
end

#queryObject (readonly)

Returns the value of attribute query.



504
505
506
# File 'lib/r43.rb', line 504

def query
  @query
end

#serviceObject (readonly)

Returns the value of attribute service.



504
505
506
# File 'lib/r43.rb', line 504

def service
  @service
end

#tagsObject (readonly)

Returns the value of attribute tags.



504
505
506
# File 'lib/r43.rb', line 504

def tags
  @tags
end

#total_availableObject (readonly)

Returns the value of attribute total_available.



504
505
506
# File 'lib/r43.rb', line 504

def total_available
  @total_available
end

#xmlObject (readonly)

Returns the value of attribute xml.



504
505
506
# File 'lib/r43.rb', line 504

def xml
  @xml
end

Instance Method Details

#moreObject



525
526
527
528
# File 'lib/r43.rb', line 525

def more()
  clear_arrays()
  _populate_collections_from_xml(service.get_response(query + "&offset=#{@next_offset}"))
end