Class: Epguides::Season
- Inherits:
-
Object
- Object
- Epguides::Season
- Defined in:
- lib/epguides/season.rb
Instance Attribute Summary collapse
-
#episodes ⇒ Object
readonly
Returns the value of attribute episodes.
-
#season ⇒ Object
readonly
Returns the value of attribute season.
Instance Method Summary collapse
- #episode(n) ⇒ Object
-
#initialize(season, episodes = []) ⇒ Season
constructor
A new instance of Season.
Constructor Details
#initialize(season, episodes = []) ⇒ Season
Returns a new instance of Season.
5 6 7 8 |
# File 'lib/epguides/season.rb', line 5 def initialize(season, episodes=[]) @episodes = episodes @season = season end |
Instance Attribute Details
#episodes ⇒ Object (readonly)
Returns the value of attribute episodes.
3 4 5 |
# File 'lib/epguides/season.rb', line 3 def episodes @episodes end |
#season ⇒ Object (readonly)
Returns the value of attribute season.
3 4 5 |
# File 'lib/epguides/season.rb', line 3 def season @season end |
Instance Method Details
#episode(n) ⇒ Object
10 11 12 |
# File 'lib/epguides/season.rb', line 10 def episode(n) @episodes.find {|ep| ep.number.to_i == n} end |