class CarmelHockey::Season
Attributes
id[RW]
name[RW]
Public Class Methods
all()
click to toggle source
# File lib/carmel_hockey/season.rb, line 21 def all page.css('select[name="sel_ChildSeason"] option').map do |option| Season.new(id: option.attribute('value').text, name: option.text) end end
new(attributes = {})
click to toggle source
Calls superclass method
# File lib/carmel_hockey/season.rb, line 9 def initialize(attributes = {}) super self.id = id.to_i end
Private Class Methods
page()
click to toggle source
# File lib/carmel_hockey/season.rb, line 30 def page Nokogiri::HTML(open('http://admin.esportsdesk.com/leagues/stats_hockey.cfm?leagueID=16561&clientID=4754')) end
Public Instance Methods
leaders()
click to toggle source
# File lib/carmel_hockey/season.rb, line 14 def leaders Leader.all(season: id) end