Class: Epguides::Episode

Inherits:
Object
  • Object
show all
Defined in:
lib/epguides/episode.rb

Constant Summary collapse

REGX =
/(\d+)\s+(\d+)-(\d+)\s+(.*)\s+(\d*\/*\w{3}\/\d{2})\s+(.+\Z)/

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(season, number, prod_number, air_date, title) ⇒ Episode

Returns a new instance of Episode.



7
8
9
10
11
12
13
# File 'lib/epguides/episode.rb', line 7

def initialize(season, number, prod_number, air_date, title)
  @season       = season
  @number       = number
  @prod_number  = prod_number.strip
  @air_date     = parse_date(air_date)
  @title        = title.strip
end

Instance Attribute Details

#air_dateObject (readonly)

Returns the value of attribute air_date.



5
6
7
# File 'lib/epguides/episode.rb', line 5

def air_date
  @air_date
end

#numberObject (readonly)

Returns the value of attribute number.



5
6
7
# File 'lib/epguides/episode.rb', line 5

def number
  @number
end

#seasonObject (readonly)

Returns the value of attribute season.



5
6
7
# File 'lib/epguides/episode.rb', line 5

def season
  @season
end

#titleObject (readonly)

Returns the value of attribute title.



5
6
7
# File 'lib/epguides/episode.rb', line 5

def title
  @title
end