Class: PlantToxicity::Plant

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, url) ⇒ Plant

Returns a new instance of Plant.



5
6
7
8
# File 'lib/plant_toxicity/plant.rb', line 5

def initialize(name, url)
  @name = name
  @url = url
end

Instance Attribute Details

#clinical_signsObject

Returns the value of attribute clinical_signs.



3
4
5
# File 'lib/plant_toxicity/plant.rb', line 3

def clinical_signs
  @clinical_signs
end

#nameObject

Returns the value of attribute name.



3
4
5
# File 'lib/plant_toxicity/plant.rb', line 3

def name
  @name
end

#non_toxicityObject

Returns the value of attribute non_toxicity.



3
4
5
# File 'lib/plant_toxicity/plant.rb', line 3

def non_toxicity
  @non_toxicity
end

#other_namesObject

Returns the value of attribute other_names.



3
4
5
# File 'lib/plant_toxicity/plant.rb', line 3

def other_names
  @other_names
end

#scientific_nameObject

Returns the value of attribute scientific_name.



3
4
5
# File 'lib/plant_toxicity/plant.rb', line 3

def scientific_name
  @scientific_name
end

#toxicityObject

Returns the value of attribute toxicity.



3
4
5
# File 'lib/plant_toxicity/plant.rb', line 3

def toxicity
  @toxicity
end

#urlObject

Returns the value of attribute url.



3
4
5
# File 'lib/plant_toxicity/plant.rb', line 3

def url
  @url
end

Instance Method Details

#detailsObject



10
11
12
13
14
# File 'lib/plant_toxicity/plant.rb', line 10

def details
  [:@other_names, :@scientific_name, :@toxicity, :@non_toxicity, :@clinical_signs].reject do |var|
    self.instance_variable_get(var) == nil || self.instance_variable_get(var) == ""
  end
end