Class: PlantToxicity::Plant
- Inherits:
-
Object
- Object
- PlantToxicity::Plant
- Defined in:
- lib/plant_toxicity/plant.rb
Instance Attribute Summary collapse
-
#clinical_signs ⇒ Object
Returns the value of attribute clinical_signs.
-
#name ⇒ Object
Returns the value of attribute name.
-
#non_toxicity ⇒ Object
Returns the value of attribute non_toxicity.
-
#other_names ⇒ Object
Returns the value of attribute other_names.
-
#scientific_name ⇒ Object
Returns the value of attribute scientific_name.
-
#toxicity ⇒ Object
Returns the value of attribute toxicity.
-
#url ⇒ Object
Returns the value of attribute url.
Instance Method Summary collapse
- #details ⇒ Object
-
#initialize(name, url) ⇒ Plant
constructor
A new instance of Plant.
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_signs ⇒ Object
Returns the value of attribute clinical_signs.
3 4 5 |
# File 'lib/plant_toxicity/plant.rb', line 3 def clinical_signs @clinical_signs end |
#name ⇒ Object
Returns the value of attribute name.
3 4 5 |
# File 'lib/plant_toxicity/plant.rb', line 3 def name @name end |
#non_toxicity ⇒ Object
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_names ⇒ Object
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_name ⇒ Object
Returns the value of attribute scientific_name.
3 4 5 |
# File 'lib/plant_toxicity/plant.rb', line 3 def scientific_name @scientific_name end |
#toxicity ⇒ Object
Returns the value of attribute toxicity.
3 4 5 |
# File 'lib/plant_toxicity/plant.rb', line 3 def toxicity @toxicity end |
#url ⇒ Object
Returns the value of attribute url.
3 4 5 |
# File 'lib/plant_toxicity/plant.rb', line 3 def url @url end |
Instance Method Details
#details ⇒ Object
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 |