class Attractions

Attributes

city[RW]
current_crowd_rating[RW]
description[RW]
hours[RW]
list[RW]
name[RW]
priority_attractions[RW]
rating[RW]
url[RW]

Public Class Methods

all() click to toggle source
# File lib/undercover_tourist_cli/attractions.rb, line 19
def self.all
  @@all 
end
find_by_name(name) click to toggle source
# File lib/undercover_tourist_cli/attractions.rb, line 27
def self.find_by_name(name)
  @@all.detect {|a| a.name == name}
end
new(name = nil, description = nil, rating = nil, current_crowd_rating = nil, priority_attractions = nil, hours = nil, url = nil, city = nil) click to toggle source
# File lib/undercover_tourist_cli/attractions.rb, line 7
def initialize(name = nil, description = nil, rating = nil, current_crowd_rating = nil, priority_attractions = nil, hours = nil, url = nil, city = nil)
  @name = name
  @description = description
  @rating = rating
  @current_crowd_rating = current_crowd_rating
  @priority_attractions = []
  @hours = hours
  @city = city
  @url = url
  @@all << self
end

Public Instance Methods

find_by_city(city) click to toggle source
# File lib/undercover_tourist_cli/attractions.rb, line 23
def find_by_city(city)
  self.all.select {|a| a.city == city}
end