class Country
Attributes
iso[RW]
long_term[RW]
name[RW]
nuclear_electricity[RW]
operational[RW]
permanent_shutdown[RW]
reactors[RW]
total_electricity[RW]
under_construction[RW]
Public Class Methods
all()
click to toggle source
# File lib/country.rb, line 20 def self.all @@all end
new(country_data)
click to toggle source
# File lib/country.rb, line 8 def initialize(country_data) #country_data is a hash that NuclearPowerReactors class will produce by scraping data @reactors = [] #an array of all the reactors in the country country_data.each do |attribute, value| self.send(("#{attribute}="), value) end @@all << self end