Class: Species

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(species) ⇒ Species

Returns a new instance of Species.



3
4
5
6
7
# File 'lib/star_wars_finder/species.rb', line 3

def initialize(species)
  @name = species["name"]
  @classification = species["classification"]
  @average_lifespan = species["average_lifespan"]
end

Instance Attribute Details

#average_lifespanObject (readonly)

Returns the value of attribute average_lifespan.



2
3
4
# File 'lib/star_wars_finder/species.rb', line 2

def average_lifespan
  @average_lifespan
end

#classificationObject (readonly)

Returns the value of attribute classification.



2
3
4
# File 'lib/star_wars_finder/species.rb', line 2

def classification
  @classification
end

#nameObject (readonly)

Returns the value of attribute name.



2
3
4
# File 'lib/star_wars_finder/species.rb', line 2

def name
  @name
end