Class: EndangeredSpecies::Species

Inherits:
Object
  • Object
show all
Defined in:
lib/endangered_species/species.rb

Overview

Stores data on all Species

Constant Summary collapse

@@all =
[]

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#habitatObject

Returns the value of attribute habitat.



4
5
6
# File 'lib/endangered_species/species.rb', line 4

def habitat
  @habitat
end

#locationObject

Returns the value of attribute location.



4
5
6
# File 'lib/endangered_species/species.rb', line 4

def location
  @location
end

#nameObject

Returns the value of attribute name.



4
5
6
# File 'lib/endangered_species/species.rb', line 4

def name
  @name
end

#placeObject

Returns the value of attribute place.



4
5
6
# File 'lib/endangered_species/species.rb', line 4

def place
  @place
end

#scientificObject

Returns the value of attribute scientific.



4
5
6
# File 'lib/endangered_species/species.rb', line 4

def scientific
  @scientific
end

#statusObject

Returns the value of attribute status.



4
5
6
# File 'lib/endangered_species/species.rb', line 4

def status
  @status
end

#summaryObject

Returns the value of attribute summary.



4
5
6
# File 'lib/endangered_species/species.rb', line 4

def summary
  @summary
end

#urlObject

Returns the value of attribute url.



4
5
6
# File 'lib/endangered_species/species.rb', line 4

def url
  @url
end

Class Method Details

.allObject

class reader to expose @@all class variable



8
9
10
# File 'lib/endangered_species/species.rb', line 8

def self.all #class reader to expose @@all class variable
  @@all
end

Instance Method Details

#saveObject



12
13
14
# File 'lib/endangered_species/species.rb', line 12

def save
  @@all << self
end