lib/lanyrd/client.rb in lanyrd-1.1.2 vs lib/lanyrd/client.rb in lanyrd-1.1.3

- old
+ new

@@ -15,19 +15,19 @@ def event(slug, year = Time.now.year) get("#{year}/#{slug}/") end def speakers(slug, year = Time.now.year) - get("#{year}/#{slug}/speakers/")['sections'][0]['rows'] + get_rows(get("#{year}/#{slug}/speakers/")["sections"]) end def attendees(slug, year = Time.now.year) - get("#{year}/#{slug}/attendees/")['sections'][0]['rows'] + get_rows(get("#{year}/#{slug}/attendees/")['sections']) end def schedule(slug, year = Time.now.year) - get("#{year}/#{slug}/schedule/")['sections'][0]['rows'] + get_rows(get("#{year}/#{slug}/schedule/")['sections']) end def profile(username) get("profile/#{username}/") end @@ -58,7 +58,13 @@ conn.headers['X-Lanyrd-PushEnvironment'] = "ios-production" conn.headers['x-mycustomurl-intercept'] = "api" conn end + + def get_rows(section_list) + rows = [] + section_list.each {|s| rows.concat(s["rows"])} + rows + end end -end \ No newline at end of file +end