Class: PokeApi::Move::PastMoveStatValue
- Inherits:
-
Object
- Object
- PokeApi::Move::PastMoveStatValue
- 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
-
#accuracy ⇒ Object
readonly
Returns the value of attribute accuracy.
-
#effect_chance ⇒ Object
readonly
Returns the value of attribute effect_chance.
-
#effect_entries ⇒ Object
readonly
Returns the value of attribute effect_entries.
-
#power ⇒ Object
readonly
Returns the value of attribute power.
-
#pp ⇒ Object
readonly
Returns the value of attribute pp.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
-
#version_group ⇒ Object
readonly
Returns the value of attribute version_group.
Instance Method Summary collapse
-
#initialize(data) ⇒ PastMoveStatValue
constructor
A new instance of PastMoveStatValue.
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
#accuracy ⇒ Object (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_chance ⇒ Object (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_entries ⇒ Object (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 |
#power ⇒ Object (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 |
#pp ⇒ Object (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 |
#type ⇒ Object (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_group ⇒ Object (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 |