Class: LOLFaker::Item
- Inherits:
-
Object
- Object
- LOLFaker::Item
- Defined in:
- lib/lolfaker/item.rb
Class Method Summary collapse
- .advanced ⇒ Object
- .basic ⇒ Object
- .consumable ⇒ Object
- .legendary ⇒ Object
- .mythical ⇒ Object
- .name ⇒ Object
Class Method Details
.advanced ⇒ Object
17 18 19 20 21 |
# 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 ⇒ Object
11 12 13 14 15 |
# 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 ⇒ Object
34 35 36 |
# 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 ⇒ Object
23 24 25 26 27 |
# 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 ⇒ Object
29 30 31 32 |
# 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 ⇒ Object
7 8 9 |
# File 'lib/lolfaker/item.rb', line 7 def self.name [basic, advanced, legendary, mythical, consumable].sample end |