Class: Sofa::TVRage::Episode

Inherits:
Object
Includes:
Sofa::Mapping
Defined in:
lib/sofa/tvrage/episode.rb

Overview

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

See Also:

Attribute Summary

Method Summary

Methods included from Sofa::Mapping

included

Constructor Details

- (Episode) initialize(info)

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

Parameters:

  • (Hash<Symbol, Object>) info — Info to initialize with

Options Hash (info):

  • (String) :epnum N/A —The episode number in the context of all episodes
  • (String) :seasonnum N/A —The episode number in the context of its season
  • (String) :prodnum N/A
  • (String) :airdate N/A —The date the episode airs
  • (String) :link N/A —The TVRage page for this Episode
  • (String) :title N/A —The title of this Episode
  • (String) :season_num N/A —The season number of the Season this Episode belongs to

Returns:

  • (Episode) — a new instance of +Episode+


34
35
36
# File 'lib/sofa/tvrage/episode.rb', line 34

def initialize(info)
  update_with_mapping(info)
end

Attribute Details

- (Object) season_num (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.



22
23
24
# File 'lib/sofa/tvrage/episode.rb', line 22

def season_num
  @season_num
end