Class: PokeApi::EvolutionChain::ChainLink
- Inherits:
-
Object
- Object
- PokeApi::EvolutionChain::ChainLink
- Includes:
- AssignmentHelpers
- Defined in:
- lib/poke_api/evolution_chain.rb
Overview
ChainLink object handling linked list type data regarding pokemon evolutions
Instance Attribute Summary collapse
-
#evolution_details ⇒ Object
readonly
Returns the value of attribute evolution_details.
-
#evolves_to ⇒ Object
readonly
Returns the value of attribute evolves_to.
-
#is_baby ⇒ Object
readonly
Returns the value of attribute is_baby.
-
#species ⇒ Object
readonly
Returns the value of attribute species.
Instance Method Summary collapse
-
#initialize(data) ⇒ ChainLink
constructor
A new instance of ChainLink.
Methods included from AssignmentHelpers
assign_list, custom_endpoint_object, endpoint_assignment, get_named_api_resource_from_url, try_to_assign
Constructor Details
#initialize(data) ⇒ ChainLink
Returns a new instance of ChainLink.
20 21 22 23 24 25 |
# File 'lib/poke_api/evolution_chain.rb', line 20 def initialize(data) @is_baby = data[:is_baby] @species = PokemonSpecies.new(data[:species]) @evolution_details = assign_list(data: data[:evolution_details], klass: EvolutionDetail) @evolves_to = assign_list(data: data[:evolves_to], klass: ChainLink) end |
Instance Attribute Details
#evolution_details ⇒ Object (readonly)
Returns the value of attribute evolution_details.
15 16 17 |
# File 'lib/poke_api/evolution_chain.rb', line 15 def evolution_details @evolution_details end |
#evolves_to ⇒ Object (readonly)
Returns the value of attribute evolves_to.
15 16 17 |
# File 'lib/poke_api/evolution_chain.rb', line 15 def evolves_to @evolves_to end |
#is_baby ⇒ Object (readonly)
Returns the value of attribute is_baby.
15 16 17 |
# File 'lib/poke_api/evolution_chain.rb', line 15 def is_baby @is_baby end |
#species ⇒ Object (readonly)
Returns the value of attribute species.
15 16 17 |
# File 'lib/poke_api/evolution_chain.rb', line 15 def species @species end |