rdavid1099/poke-api-v2

View on GitHub
lib/poke_api/type.rb

Summary

Maintainability
A
0 mins
Test Coverage
A
100%
module PokeApi
  # Type object handling all data fetched from /type
  class Type < NamedApiResource
    attr_reader :damage_relations,
                :game_indices,
                :generation,
                :move_damage_class,
                :names,
                :pokemon,
                :move

    def initialize(data)
      assign_data(data)
    end

    private

    def custom_endpoint_object
      {
        damage_relations: TypeRelations,
        game_indices: Common::GenerationGameIndex,
        pokemon: TypePokemon
      }
    end
  end
end