Class: Sofa::TVRage::Episode
- Inherits:
-
Object
- Object
- Sofa::TVRage::Episode
- Includes:
- HTTParty, Mapping
- Defined in:
- lib/sofa/tvrage/episode.rb
Overview
This class holds the XML information of a single episode as per the TVRage API.
Instance Attribute Summary collapse
-
#season_num ⇒ Object
readonly
The season number of the Season this Episode belongs to.
Class Method Summary collapse
-
.info(sid, season_no, ep_num) ⇒ Hash
Gets the info for a Episode.
Instance Method Summary collapse
-
#initialize(info) ⇒ Episode
constructor
Returns a new instance of Episode, mapping info from the TVRage API.
Methods included from Mapping
Constructor Details
#initialize(info) ⇒ Episode
Returns a new instance of Episode, mapping info from the TVRage API
51 52 53 |
# File 'lib/sofa/tvrage/episode.rb', line 51
def initialize(info)
update_with_mapping(info)
end
|
Instance Attribute Details
#season_num ⇒ Object (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.
39 40 41 |
# File 'lib/sofa/tvrage/episode.rb', line 39
def season_num
@season_num
end
|
Class Method Details
.info(sid, season_no, ep_num) ⇒ Hash
Gets the info for a Episode.
19 20 21 22 |
# File 'lib/sofa/tvrage/episode.rb', line 19
def info(sid, season_no, ep_num)
xml = get('/feeds/episodeinfo.php', :query => {:sid => sid, :ep => "#{season_no}x#{ep_num}"})
xml["show"]
end
|