class Npbs::TeamPlayers

Attributes

name[R]
path[R]
players[R]

Public Class Methods

new(name, path) click to toggle source
Calls superclass method Npbs::NPB::new
# File lib/npbs.rb, line 115
def initialize(name, path)
  super()
  @name = name
  @path = path
  @players = []
end

Public Instance Methods

fetch() click to toggle source
# File lib/npbs.rb, line 121
def fetch
  fetch_doc.css('.rosterPlayer').each do |node|
    node.css('a').each do |p|
      name = p.inner_text.gsub(/ /,' ')
      next if name =~ /※/
      path = p.attributes.first[1].value
      @players << Player.new(name,path)
    end
  end
  @players
end