Class: PokeApi::Item::ItemHolderPokemon
- Inherits:
-
Object
- Object
- PokeApi::Item::ItemHolderPokemon
- Includes:
- AssignmentHelpers
- Defined in:
- lib/poke_api/item/item_holder_pokemon.rb
Overview
ItemHolderPokemon object handling all sprite data fetched from /item
Instance Attribute Summary collapse
-
#pokemon ⇒ Object
readonly
Returns the value of attribute pokemon.
-
#version_details ⇒ Object
readonly
Returns the value of attribute version_details.
Instance Method Summary collapse
-
#initialize(data) ⇒ ItemHolderPokemon
constructor
A new instance of ItemHolderPokemon.
Methods included from AssignmentHelpers
assign_list, custom_endpoint_object, endpoint_assignment, get_named_api_resource_from_url, try_to_assign
Constructor Details
#initialize(data) ⇒ ItemHolderPokemon
Returns a new instance of ItemHolderPokemon.
10 11 12 13 14 15 16 |
# File 'lib/poke_api/item/item_holder_pokemon.rb', line 10 def initialize(data) @pokemon = Pokemon.new(data[:pokemon]) @version_details = assign_list( data: data[:version_details], klass: ItemHolderPokemonVersionDetail ) end |
Instance Attribute Details
#pokemon ⇒ Object (readonly)
Returns the value of attribute pokemon.
7 8 9 |
# File 'lib/poke_api/item/item_holder_pokemon.rb', line 7 def pokemon @pokemon end |
#version_details ⇒ Object (readonly)
Returns the value of attribute version_details.
7 8 9 |
# File 'lib/poke_api/item/item_holder_pokemon.rb', line 7 def version_details @version_details end |