Module: Ketchum

Defined in:
lib/ketchum.rb,
lib/ketchum/version.rb

Constant Summary collapse

BASE_URL =
'http://pokeapi.co/api/v2/'
RESOURCES =
[
  'ability', 'berry', 'berry_firmness', 'berry_flavor', 'characteristic',
  'contest_effect', 'contest_type', 'egg_group', 'encounter_condition',
  'encounter_condition_value', 'encounter_method', 'evolution_chain',
  'evolution_trigger', 'gender', 'generation', 'growth_rate', 'item',
  'item_attribute', 'item_category', 'item_fling_effect', 'item_pocket',
  'language', 'location', 'location_area', 'move', 'move_ailment',
  'move_battle_style', 'move_category', 'move_damage_class',
  'move_learn_method', 'move_target', 'nature', 'pal_park_area',
  'pokeathlon_stat', 'pokedex', 'pokemon', 'pokemon_color', 'pokemon_form',
  'pokemon_shape', 'pokemon_species', 'region', 'stat',
  'super_contest_effect', 'type', 'version', 'version_group'
]
VERSION =
"0.1.0"

Class Method Summary collapse

Class Method Details

.initialize(format = :json) ⇒ Object



24
25
26
# File 'lib/ketchum.rb', line 24

def initialize(format = :json)
  @format = format
end

.method_missing(method, *args) ⇒ Object



28
29
30
31
32
33
# File 'lib/ketchum.rb', line 28

def method_missing(method, *args)
  if RESOURCES.include? method.to_s
    method = hyphenate(method.to_s)
    get(method.to_s, args[0], args[1])
  end
end