Class: Torganiser::Series

Inherits:
Object
  • Object
show all
Defined in:
lib/torganiser/series.rb

Overview

Models the series information from an episode file

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#nameObject (readonly)

Returns the value of attribute name.



4
5
6
# File 'lib/torganiser/series.rb', line 4

def name
  @name
end

#yearObject (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_nameObject



11
12
13
# File 'lib/torganiser/series.rb', line 11

def display_name
  @display_name = year ? "#{name} (#{year})" : name
end