Class: EventMachine::Sofa::TVRage::Episode

Inherits:
Object
  • Object
show all
Includes:
Mapping
Defined in:
lib/em-sofa/tvrage/episode.rb

Overview

This class holds the XML information of a single episode as per the TVRage API.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(info) ⇒ Episode

Returns a new instance of Episode, mapping info from the TVRage API

Parameters:

  • info (Hash<Symbol, Object>)

    Info to initialize with

Options Hash (info):

  • :epnum (String)

    The episode number in the context of all episodes

  • :seasonnum (String)

    The episode number in the context of its season

  • :prodnum (String)
  • :airdate (String)

    The date the episode airs

  • :link (String)

    The TVRage page for this Episode

  • :title (String)

    The title of this Episode

  • :season_num (String)

    The season number of the Season this Episode belongs to



35
36
37
# File 'lib/em-sofa/tvrage/episode.rb', line 35

def initialize(info)
  update_with_mapping(info)
end

Instance Attribute Details

#season_numObject (readonly)

The season number of the Season this Episode belongs to. Not actually a part of the TVRage API, but it's used to inject the +season_num+ when looping through Episodes in a Season.



23
24
25
# File 'lib/em-sofa/tvrage/episode.rb', line 23

def season_num
  @season_num
end