Class: Species
- Inherits:
-
Object
- Object
- Species
- Defined in:
- lib/star_wars_finder/species.rb
Instance Attribute Summary collapse
-
#average_lifespan ⇒ Object
readonly
Returns the value of attribute average_lifespan.
-
#classification ⇒ Object
readonly
Returns the value of attribute classification.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
-
#initialize(species) ⇒ Species
constructor
A new instance of Species.
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_lifespan ⇒ Object (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 |
#classification ⇒ Object (readonly)
Returns the value of attribute classification.
2 3 4 |
# File 'lib/star_wars_finder/species.rb', line 2 def classification @classification end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
2 3 4 |
# File 'lib/star_wars_finder/species.rb', line 2 def name @name end |