Class: Torganiser::Series
- Inherits:
-
Object
- Object
- Torganiser::Series
- Defined in:
- lib/torganiser/series.rb
Overview
Models the series information from an episode file
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#year ⇒ Object
readonly
Returns the value of attribute year.
Instance Method Summary collapse
- #display_name ⇒ Object
-
#initialize(name, year: nil) ⇒ Series
constructor
A new instance of Series.
Constructor Details
#initialize(name, year: nil) ⇒ Series
Returns a new instance of Series.
6 7 8 9 |
# File 'lib/torganiser/series.rb', line 6 def initialize(name, year: nil) @name = name @year = year end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
4 5 6 |
# File 'lib/torganiser/series.rb', line 4 def name @name end |
#year ⇒ Object (readonly)
Returns the value of attribute year.
4 5 6 |
# File 'lib/torganiser/series.rb', line 4 def year @year end |
Instance Method Details
#display_name ⇒ Object
11 12 13 |
# File 'lib/torganiser/series.rb', line 11 def display_name @display_name = year ? "#{name} (#{year})" : name end |