class Restaurant
Attributes
best_dish[RW]
contact[RW]
description[RW]
food_style[RW]
head_chef[RW]
location[RW]
name[RW]
position[RW]
url[RW]
website_url[RW]
Public Class Methods
all()
click to toggle source
# File lib/50_best_restaurants/restaurant.rb, line 15 def self.all @@all end
find(id)
click to toggle source
# File lib/50_best_restaurants/restaurant.rb, line 19 def self.find(id) self.all[id-1] end
new(name=nil, url=nil, location=nil, position=nil)
click to toggle source
# File lib/50_best_restaurants/restaurant.rb, line 7 def initialize(name=nil, url=nil, location=nil, position=nil) @name = name @url = url @location = location @position = position @@all << self end
Public Instance Methods
doc()
click to toggle source
# File lib/50_best_restaurants/restaurant.rb, line 47 def doc @doc ||= Nokogiri::HTML(open(self.url)) end