Class: P3::Eztv::Episode

Inherits:
Object
  • Object
show all
Defined in:
lib/p3-eztv.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(episode_node) ⇒ Episode

Returns a new instance of Episode.



104
105
106
107
# File 'lib/p3-eztv.rb', line 104

def initialize(episode_node)
    set_season_and_episode_number(episode_node)
    set_links(episode_node)
end

Instance Attribute Details

#episode_numberObject

Returns the value of attribute episode_number.



102
103
104
# File 'lib/p3-eztv.rb', line 102

def episode_number
  @episode_number
end

Returns the value of attribute links.



102
103
104
# File 'lib/p3-eztv.rb', line 102

def links
  @links
end

Returns the value of attribute magnet_link.



102
103
104
# File 'lib/p3-eztv.rb', line 102

def magnet_link
  @magnet_link
end

#raw_titleObject

Returns the value of attribute raw_title.



102
103
104
# File 'lib/p3-eztv.rb', line 102

def raw_title
  @raw_title
end

#seasonObject

Returns the value of attribute season.



102
103
104
# File 'lib/p3-eztv.rb', line 102

def season
  @season
end

Instance Method Details

#eql?(other) ⇒ Boolean

Returns:

  • (Boolean)


113
114
115
# File 'lib/p3-eztv.rb', line 113

def eql?(other)
    other.hash == self.hash
end

#hashObject



117
118
119
# File 'lib/p3-eztv.rb', line 117

def hash
    [episode_number, season].hash
end

#s01e01_formatObject



109
110
111
# File 'lib/p3-eztv.rb', line 109

def s01e01_format
    @s01e01_format ||= "S#{season.to_s.rjust(2,'0')}E#{episode_number.to_s.rjust(2,'0')}"
end