Class: PokeApi::Move::PastMoveStatValue

Inherits:
Object
  • Object
show all
Includes:
AssignmentHelpers
Defined in:
lib/poke_api/move/past_move_stat_value.rb

Overview

PastMoveStatValue object handling all data fetched from /move for past_values

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) ⇒ PastMoveStatValue

Returns a new instance of PastMoveStatValue.



15
16
17
18
19
20
21
22
23
# File 'lib/poke_api/move/past_move_stat_value.rb', line 15

def initialize(data)
  @accuracy = data[:accuracy]
  @effect_chance = data[:effect_chance]
  @power = data[:power]
  @pp = data[:pp]
  @effect_entries = assign_list(data: data[:effect_entries], klass: Common::VerboseEffect)
  @type = try_to_assign(data: data[:type], klass: Type)
  @version_group = try_to_assign(data: data[:version_group], klass: VersionGroup)
end

Instance Attribute Details

#accuracyObject (readonly)

Returns the value of attribute accuracy.



7
8
9
# File 'lib/poke_api/move/past_move_stat_value.rb', line 7

def accuracy
  @accuracy
end

#effect_chanceObject (readonly)

Returns the value of attribute effect_chance.



7
8
9
# File 'lib/poke_api/move/past_move_stat_value.rb', line 7

def effect_chance
  @effect_chance
end

#effect_entriesObject (readonly)

Returns the value of attribute effect_entries.



7
8
9
# File 'lib/poke_api/move/past_move_stat_value.rb', line 7

def effect_entries
  @effect_entries
end

#powerObject (readonly)

Returns the value of attribute power.



7
8
9
# File 'lib/poke_api/move/past_move_stat_value.rb', line 7

def power
  @power
end

#ppObject (readonly)

Returns the value of attribute pp.



7
8
9
# File 'lib/poke_api/move/past_move_stat_value.rb', line 7

def pp
  @pp
end

#typeObject (readonly)

Returns the value of attribute type.



7
8
9
# File 'lib/poke_api/move/past_move_stat_value.rb', line 7

def type
  @type
end

#version_groupObject (readonly)

Returns the value of attribute version_group.



7
8
9
# File 'lib/poke_api/move/past_move_stat_value.rb', line 7

def version_group
  @version_group
end