class LOLFaker::Item
Public Class Methods
advanced()
click to toggle source
# File lib/lolfaker/item.rb, line 17 def self.advanced advanced = Nokogiri::HTML(open("http://leagueoflegends.wikia.com/wiki/Advanced_item")).search('#mw-content-text > table > tr > th > p > b').map{|name| name.text} advanced.delete('') advanced.sample end
basic()
click to toggle source
# File lib/lolfaker/item.rb, line 11 def self.basic basic = Nokogiri::HTML(open("http://leagueoflegends.wikia.com/wiki/Basic_item")).search('#mw-content-text > table > tr > th > p > b').map{|name| name.text} basic.delete('') basic.sample end
consumable()
click to toggle source
# File lib/lolfaker/item.rb, line 34 def self.consumable consumable = Nokogiri::HTML(open("http://leagueoflegends.wikia.com/wiki/Consumable_item")).search('#mw-content-text > table > tr > th > b > span > a > span').map{|name| name.text}.sample end
legendary()
click to toggle source
# File lib/lolfaker/item.rb, line 23 def self.legendary legendary = Nokogiri::HTML(open("http://leagueoflegends.wikia.com/wiki/Legendary_item")).search('#mw-content-text > table > tr > th > p > b').map{|name| name.text} legendary.delete('') legendary.sample end
mythical()
click to toggle source
# File lib/lolfaker/item.rb, line 29 def self.mythical mythical = Nokogiri::HTML(open("http://leagueoflegends.wikia.com/wiki/Mythical_item")).search('#mw-content-text > table > tr > th > p > a').map{|name| name.text} mythical.push('Perfect Hex Core').sample end
name()
click to toggle source
# File lib/lolfaker/item.rb, line 7 def self.name [basic, advanced, legendary, mythical, consumable].sample end