Class: Oakdex::Pokedex::Item

Inherits:
Base
  • Object
show all
Defined in:
lib/oakdex/pokedex/item.rb

Overview

Represents the nature of a Pokemon

Instance Attribute Summary

Attributes inherited from Base

#attributes

Instance Method Summary collapse

Methods inherited from Base

add_to_all, all, find, find!, #initialize, json_folder, #method_missing, reset!, #respond_to_missing?, translate, where

Constructor Details

This class inherits a constructor from Oakdex::Pokedex::Base

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Oakdex::Pokedex::Base

Instance Method Details

#description(locale = 'en') ⇒ Object



10
11
12
13
# File 'lib/oakdex/pokedex/item.rb', line 10

def description(locale = 'en')
  translations = descriptions.last['translations']
  translations[locale] || translations['en']
end