Class: PokeApi::Type::TypeRelations
- Inherits:
-
Object
- Object
- PokeApi::Type::TypeRelations
- Includes:
- AssignmentHelpers
- Defined in:
- lib/poke_api/type/type_relations.rb
Overview
TypeRelations object handling lists of type relationships
Instance Attribute Summary collapse
-
#double_damage_from ⇒ Object
readonly
Returns the value of attribute double_damage_from.
-
#double_damage_to ⇒ Object
readonly
Returns the value of attribute double_damage_to.
-
#half_damage_from ⇒ Object
readonly
Returns the value of attribute half_damage_from.
-
#half_damage_to ⇒ Object
readonly
Returns the value of attribute half_damage_to.
-
#no_damage_from ⇒ Object
readonly
Returns the value of attribute no_damage_from.
-
#no_damage_to ⇒ Object
readonly
Returns the value of attribute no_damage_to.
Instance Method Summary collapse
-
#initialize(data) ⇒ TypeRelations
constructor
A new instance of TypeRelations.
Methods included from AssignmentHelpers
assign_list, custom_endpoint_object, endpoint_assignment, get_named_api_resource_from_url, try_to_assign
Constructor Details
#initialize(data) ⇒ TypeRelations
Returns a new instance of TypeRelations.
14 15 16 17 18 |
# File 'lib/poke_api/type/type_relations.rb', line 14 def initialize(data) data.each_key do |key| instance_variable_set("@#{key}", assign_list(data: data[key], klass: Type)) end end |
Instance Attribute Details
#double_damage_from ⇒ Object (readonly)
Returns the value of attribute double_damage_from.
7 8 9 |
# File 'lib/poke_api/type/type_relations.rb', line 7 def double_damage_from @double_damage_from end |
#double_damage_to ⇒ Object (readonly)
Returns the value of attribute double_damage_to.
7 8 9 |
# File 'lib/poke_api/type/type_relations.rb', line 7 def double_damage_to @double_damage_to end |
#half_damage_from ⇒ Object (readonly)
Returns the value of attribute half_damage_from.
7 8 9 |
# File 'lib/poke_api/type/type_relations.rb', line 7 def half_damage_from @half_damage_from end |
#half_damage_to ⇒ Object (readonly)
Returns the value of attribute half_damage_to.
7 8 9 |
# File 'lib/poke_api/type/type_relations.rb', line 7 def half_damage_to @half_damage_to end |
#no_damage_from ⇒ Object (readonly)
Returns the value of attribute no_damage_from.
7 8 9 |
# File 'lib/poke_api/type/type_relations.rb', line 7 def no_damage_from @no_damage_from end |
#no_damage_to ⇒ Object (readonly)
Returns the value of attribute no_damage_to.
7 8 9 |
# File 'lib/poke_api/type/type_relations.rb', line 7 def no_damage_to @no_damage_to end |