class WWFinder::Continent
Attributes
countries[R]
name[RW]
Public Class Methods
all()
click to toggle source
# File lib/ww_finder/continent.rb, line 13 def self.all WWFinder::Scraper.scrape_continents_and_countries if @@all.empty? @@all end
find(input)
click to toggle source
# File lib/ww_finder/continent.rb, line 18 def self.find(input) all[input] end
new(name)
click to toggle source
# File lib/ww_finder/continent.rb, line 7 def initialize(name) @name = name @countries = [] save end
Public Instance Methods
find_country(input)
click to toggle source
# File lib/ww_finder/continent.rb, line 22 def find_country(input) countries[input] end
Private Instance Methods
save()
click to toggle source
# File lib/ww_finder/continent.rb, line 27 def save @@all << self end