class IndoorJungle::Plant

Attributes

name[RW]

modeling after the student creator, I will need a place to store all the plants and then each plant's attributes

plant[RW]

modeling after the student creator, I will need a place to store all the plants and then each plant's attributes

plant_url[RW]

modeling after the student creator, I will need a place to store all the plants and then each plant's attributes

price_range[RW]

modeling after the student creator, I will need a place to store all the plants and then each plant's attributes

sunlight[RW]

modeling after the student creator, I will need a place to store all the plants and then each plant's attributes

temperature[RW]

modeling after the student creator, I will need a place to store all the plants and then each plant's attributes

water[RW]

modeling after the student creator, I will need a place to store all the plants and then each plant's attributes

Public Class Methods

all() click to toggle source
# File lib/indoor_jungle/plant.rb, line 15
def self.all
  @@all
end
create_from_collection(plants_array) click to toggle source
# File lib/indoor_jungle/plant.rb, line 19
def self.create_from_collection(plants_array)
  plants_array.each do |plant|
    plant = self.new(plant)
    @@plants << plant
  end
end
new(plant_hash) click to toggle source
# File lib/indoor_jungle/plant.rb, line 10
def initialize(plant_hash)
  plant_hash.each {|key, value| self.send(("#{key}="), value)}
  @@all << self
end

Public Instance Methods

add_plant_attributes(attributes_hash) click to toggle source
# File lib/indoor_jungle/plant.rb, line 26
def add_plant_attributes(attributes_hash)
  attributes_hash.each {|key, value| self.send(("#{key}="), value)}
end