Class: PokeApi::EvolutionChain::EvolutionDetail

Inherits:
Object
  • Object
show all
Includes:
AssignmentHelpers
Defined in:
lib/poke_api/evolution_chain/evolution_detail.rb

Overview

EvolutionDetail object handling details data regarding pokemon evolutions

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from AssignmentHelpers

assign_list, custom_endpoint_object, endpoint_assignment, get_named_api_resource_from_url, try_to_assign

Constructor Details

#initialize(data) ⇒ EvolutionDetail

rubocop:disable Metrics/AbcSize, Metrics/MethodLength



27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
# File 'lib/poke_api/evolution_chain/evolution_detail.rb', line 27

def initialize(data)
  @item = try_to_assign(data: data[:item], klass: Item)
  @trigger = try_to_assign(data: data[:trigger], klass: EvolutionTrigger)
  @gender = data[:gender]
  @held_item = try_to_assign(data: data[:held_item], klass: Item)
  @known_move = try_to_assign(data: data[:known_move], klass: Move)
  @known_move_type = try_to_assign(data: data[:known_move_type], klass: Type)
  @location = try_to_assign(data: data[:location], klass: Location)
  @min_level = data[:min_level]
  @min_happiness = data[:min_happiness]
  @min_beauty = data[:min_beauty]
  @min_affection = data[:min_affection]
  @needs_overworld_rain = data[:needs_overworld_rain]
  @party_species = try_to_assign(data: data[:party_species], klass: PokemonSpecies)
  @party_type = try_to_assign(data: data[:party_type], klass: Type)
  @relative_physical_stats = data[:relative_physical_stats]
  @time_of_day = data[:time_of_day]
  @trade_species = try_to_assign(data: data[:trade_species], klass: PokemonSpecies)
  @turn_upside_down = data[:turn_upside_down]
end

Instance Attribute Details

#genderObject (readonly)

Returns the value of attribute gender.



7
8
9
# File 'lib/poke_api/evolution_chain/evolution_detail.rb', line 7

def gender
  @gender
end

#held_itemObject (readonly)

Returns the value of attribute held_item.



7
8
9
# File 'lib/poke_api/evolution_chain/evolution_detail.rb', line 7

def held_item
  @held_item
end

#itemObject (readonly)

Returns the value of attribute item.



7
8
9
# File 'lib/poke_api/evolution_chain/evolution_detail.rb', line 7

def item
  @item
end

#known_moveObject (readonly)

Returns the value of attribute known_move.



7
8
9
# File 'lib/poke_api/evolution_chain/evolution_detail.rb', line 7

def known_move
  @known_move
end

#known_move_typeObject (readonly)

Returns the value of attribute known_move_type.



7
8
9
# File 'lib/poke_api/evolution_chain/evolution_detail.rb', line 7

def known_move_type
  @known_move_type
end

#locationObject (readonly)

Returns the value of attribute location.



7
8
9
# File 'lib/poke_api/evolution_chain/evolution_detail.rb', line 7

def location
  @location
end

#min_affectionObject (readonly)

Returns the value of attribute min_affection.



7
8
9
# File 'lib/poke_api/evolution_chain/evolution_detail.rb', line 7

def min_affection
  @min_affection
end

#min_beautyObject (readonly)

Returns the value of attribute min_beauty.



7
8
9
# File 'lib/poke_api/evolution_chain/evolution_detail.rb', line 7

def min_beauty
  @min_beauty
end

#min_happinessObject (readonly)

Returns the value of attribute min_happiness.



7
8
9
# File 'lib/poke_api/evolution_chain/evolution_detail.rb', line 7

def min_happiness
  @min_happiness
end

#min_levelObject (readonly)

Returns the value of attribute min_level.



7
8
9
# File 'lib/poke_api/evolution_chain/evolution_detail.rb', line 7

def min_level
  @min_level
end

#needs_overworld_rainObject (readonly)

Returns the value of attribute needs_overworld_rain.



7
8
9
# File 'lib/poke_api/evolution_chain/evolution_detail.rb', line 7

def needs_overworld_rain
  @needs_overworld_rain
end

#party_speciesObject (readonly)

Returns the value of attribute party_species.



7
8
9
# File 'lib/poke_api/evolution_chain/evolution_detail.rb', line 7

def party_species
  @party_species
end

#party_typeObject (readonly)

Returns the value of attribute party_type.



7
8
9
# File 'lib/poke_api/evolution_chain/evolution_detail.rb', line 7

def party_type
  @party_type
end

#relative_physical_statsObject (readonly)

Returns the value of attribute relative_physical_stats.



7
8
9
# File 'lib/poke_api/evolution_chain/evolution_detail.rb', line 7

def relative_physical_stats
  @relative_physical_stats
end

#time_of_dayObject (readonly)

Returns the value of attribute time_of_day.



7
8
9
# File 'lib/poke_api/evolution_chain/evolution_detail.rb', line 7

def time_of_day
  @time_of_day
end

#trade_speciesObject (readonly)

Returns the value of attribute trade_species.



7
8
9
# File 'lib/poke_api/evolution_chain/evolution_detail.rb', line 7

def trade_species
  @trade_species
end

#triggerObject (readonly)

Returns the value of attribute trigger.



7
8
9
# File 'lib/poke_api/evolution_chain/evolution_detail.rb', line 7

def trigger
  @trigger
end

#turn_upside_downObject (readonly)

Returns the value of attribute turn_upside_down.



7
8
9
# File 'lib/poke_api/evolution_chain/evolution_detail.rb', line 7

def turn_upside_down
  @turn_upside_down
end