Class: PlantScraper::Plant
- Inherits:
-
Object
- Object
- PlantScraper::Plant
- Defined in:
- lib/plant_info_scraper/plant.rb
Constant Summary collapse
- @@all =
[]
Instance Attribute Summary collapse
-
#height ⇒ Object
Returns the value of attribute height.
-
#light ⇒ Object
Returns the value of attribute light.
-
#name ⇒ Object
Returns the value of attribute name.
-
#summary ⇒ Object
Returns the value of attribute summary.
-
#type ⇒ Object
Returns the value of attribute type.
-
#zones ⇒ Object
Returns the value of attribute zones.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(name, light, height, zones, type, summary) ⇒ Plant
constructor
A new instance of Plant.
Constructor Details
#initialize(name, light, height, zones, type, summary) ⇒ Plant
Returns a new instance of Plant.
6 7 8 9 10 11 12 13 14 15 |
# File 'lib/plant_info_scraper/plant.rb', line 6 def initialize(name, light, height, zones, type, summary) @name = name @light = light @height = height @zones = zones @type = type @summary = summary # TODO: Breakout scientific name in future @scientific_name = scientific_name @@all << self end |
Instance Attribute Details
#height ⇒ Object
Returns the value of attribute height.
2 3 4 |
# File 'lib/plant_info_scraper/plant.rb', line 2 def height @height end |
#light ⇒ Object
Returns the value of attribute light.
2 3 4 |
# File 'lib/plant_info_scraper/plant.rb', line 2 def light @light end |
#name ⇒ Object
Returns the value of attribute name.
2 3 4 |
# File 'lib/plant_info_scraper/plant.rb', line 2 def name @name end |
#summary ⇒ Object
Returns the value of attribute summary.
2 3 4 |
# File 'lib/plant_info_scraper/plant.rb', line 2 def summary @summary end |
#type ⇒ Object
Returns the value of attribute type.
2 3 4 |
# File 'lib/plant_info_scraper/plant.rb', line 2 def type @type end |
#zones ⇒ Object
Returns the value of attribute zones.
2 3 4 |
# File 'lib/plant_info_scraper/plant.rb', line 2 def zones @zones end |
Class Method Details
.all ⇒ Object
17 18 19 |
# File 'lib/plant_info_scraper/plant.rb', line 17 def self.all @@all end |
.clear ⇒ Object
21 22 23 |
# File 'lib/plant_info_scraper/plant.rb', line 21 def self.clear @@all.clear end |