Object
TODO: very similar to concert_setlist_result, event_result, and artist_result, extract common stuff to module/superclass
Takes the result hash directly and parses out the page and total entries and finally passes off to the parse_results method to get the results.
# File lib/songkickr/location_result.rb, line 9 def initialize(result_hash = {}) results_page = result_hash["resultsPage"] if results_page @page = results_page["page"] @total_entries = results_page["totalEntries"] @results = parse_results results_page["results"] end end
Take the results hash directly and parse the locations into Location objects.
Returns an array of Locations.
# File lib/songkickr/location_result.rb, line 25 def parse_results(results = {}) locations = [] if results.include?("location") results["location"].each do |location| locations << Songkickr::Location.new(location) end end locations end
Generated with the Darkfish Rdoc Generator 2.