Class: PlantScraper::Plant

Inherits:
Object
  • Object
show all
Defined in:
lib/plant_info_scraper/plant.rb

Constant Summary collapse

@@all =
[]

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

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

#heightObject

Returns the value of attribute height.



2
3
4
# File 'lib/plant_info_scraper/plant.rb', line 2

def height
  @height
end

#lightObject

Returns the value of attribute light.



2
3
4
# File 'lib/plant_info_scraper/plant.rb', line 2

def light
  @light
end

#nameObject

Returns the value of attribute name.



2
3
4
# File 'lib/plant_info_scraper/plant.rb', line 2

def name
  @name
end

#summaryObject

Returns the value of attribute summary.



2
3
4
# File 'lib/plant_info_scraper/plant.rb', line 2

def summary
  @summary
end

#typeObject

Returns the value of attribute type.



2
3
4
# File 'lib/plant_info_scraper/plant.rb', line 2

def type
  @type
end

#zonesObject

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

.allObject



17
18
19
# File 'lib/plant_info_scraper/plant.rb', line 17

def self.all
    @@all
end

.clearObject



21
22
23
# File 'lib/plant_info_scraper/plant.rb', line 21

def self.clear
    @@all.clear
end