class Zomato2::Collection
Attributes
city_id[R]
description[R]
id[R]
image_url[R]
res_count[R]
title[R]
url[R]
Public Class Methods
new(zom_conn, cityid, attributes)
click to toggle source
Calls superclass method
# File lib/zomato2/collection.rb, line 6 def initialize(zom_conn, cityid, attributes) super(zom_conn) @city_id = cityid @id = attributes['collection_id'] @url = attributes['url'] @title = attributes['title'] @description = attributes['description'] @image_url = attributes['image_url'] @res_count = attributes['res_count'] @share_url = attributes['share_url'] end
Public Instance Methods
restaurants(start: nil, count: nil)
click to toggle source
# File lib/zomato2/collection.rb, line 18 def restaurants(start: nil, count: nil) q = {collection_id: @id, entity_type: 'city', entity_id: @city_id } q[:start] = start if start q[:count] = count if count results = get('search', q) results['restaurants'].map { |e| Restaurant.new(@zom_conn, e['restaurant']) } end