class OverwatchHelper::Character
Attributes
name[RW]
Public Class Methods
all()
click to toggle source
# File lib/overwatch_helper/character.rb, line 3 def self.all # should list all the characters self.scrape_characters end
scrape_characters()
click to toggle source
# File lib/overwatch_helper/character.rb, line 8 def self.scrape_characters index_url = "http://overwatch.wikia.com" doc = Nokogiri::HTML(open("http://overwatch.wikia.com/wiki/Overwatch_Wiki")) @characters = doc.css("div#gallery-1 div.lightbox-caption").collect do |i| { :name=>i.text } end @characters end