Class: CarmelHockey::Season
- Inherits:
-
Object
- Object
- CarmelHockey::Season
- Extended by:
- Memoist
- Includes:
- HockeyModel
- Defined in:
- lib/carmel_hockey/season.rb
Instance Attribute Summary collapse
-
#id ⇒ Object
Returns the value of attribute id.
-
#name ⇒ Object
Returns the value of attribute name.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(attributes = {}) ⇒ Season
constructor
A new instance of Season.
- #leaders ⇒ Object
Methods included from HockeyModel
Constructor Details
#initialize(attributes = {}) ⇒ Season
Returns a new instance of Season.
9 10 11 12 |
# File 'lib/carmel_hockey/season.rb', line 9 def initialize(attributes = {}) super self.id = id.to_i end |
Instance Attribute Details
#id ⇒ Object
Returns the value of attribute id.
7 8 9 |
# File 'lib/carmel_hockey/season.rb', line 7 def id @id end |
#name ⇒ Object
Returns the value of attribute name.
7 8 9 |
# File 'lib/carmel_hockey/season.rb', line 7 def name @name end |
Class Method Details
.all ⇒ Object
21 22 23 24 25 |
# 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 |
Instance Method Details
#leaders ⇒ Object
14 15 16 |
# File 'lib/carmel_hockey/season.rb', line 14 def leaders Leader.all(season: id) end |