class PlantToxicity::List

Attributes

letter[RW]
plants[RW]
scraper[R]

Public Class Methods

all() click to toggle source
# File lib/plant_toxicity/list.rb, line 14
def self.all
  @@all
end
new(letter) click to toggle source
# File lib/plant_toxicity/list.rb, line 8
def initialize(letter)
  @letter = letter.upcase
  @plants = PlantToxicity::Scraper.get_list(@letter)
  @@all << self
end

Public Instance Methods

select_plant(input) click to toggle source
# File lib/plant_toxicity/list.rb, line 18
def select_plant(input)
  plant = self.plants[input]
  PlantToxicity::Scraper.get_plant_details(plant)
  plant
end