Class: Movedex

Inherits:
Object
  • Object
show all
Defined in:
lib/botemon/movedex.rb

Overview

– Copyright© 2013 Giovanni Capuano <[email protected]>

This file is part of Botémon.

Botémon is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

Botémon is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with Botémon. If not, see <www.gnu.org/licenses/>. ++

Class Method Summary collapse

Class Method Details

.get(name, tier) ⇒ Object



29
30
31
32
# File 'lib/botemon/movedex.rb', line 29

def self.get(name, tier)
  return nil if name == nil || tier == nil
  return Smogon::Movedex.get name, tier
end

.id2name(id) ⇒ Object



21
22
23
24
25
26
27
# File 'lib/botemon/movedex.rb', line 21

def self.id2name(id)
  return begin
    Nokogiri::HTML(open("http://pokemondb.net/pokedex/#{id}")).xpath('//div[@class="navbar"]/h1')[0].text
  rescue
    nil
  end
end