class Zomato2::Category
Attributes
id[R]
name[R]
Public Class Methods
new(zom_conn, attributes)
click to toggle source
Calls superclass method
# File lib/zomato2/category.rb, line 6 def initialize(zom_conn, attributes) super(zom_conn) @id = attributes['id'] @name = attributes['name'] end
Public Instance Methods
restaurants(start: nil, count: nil)
click to toggle source
# File lib/zomato2/category.rb, line 14 def restaurants(start: nil, count: nil) q = {category_id: @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
to_s()
click to toggle source
Calls superclass method
# File lib/zomato2/category.rb, line 12 def to_s; super; end