class Npbs::TeamsPlayers
Attributes
teams[R]
Public Class Methods
new()
click to toggle source
Calls superclass method
Npbs::NPB::new
# File lib/npbs.rb, line 96 def initialize super @path = "/players/" @teams = [] end
Public Instance Methods
fetch()
click to toggle source
# File lib/npbs.rb, line 101 def fetch fetch_doc.css(".playerTeamsub").each do |node| node.css("tr:not(:first-child)").each do |team| name = team.css('a').inner_text path = team.css('a').first.attributes.first[1].value @teams << TeamPlayers.new(name, path) end end @teams end