Class: Allocine::Season
- Inherits:
-
Object
- Object
- Allocine::Season
- Defined in:
- lib/allocine/season.rb
Instance Attribute Summary collapse
-
#episodes ⇒ Object
Returns an Array of Allocine::Episode.
-
#id ⇒ Object
Returns the value of attribute id.
-
#season_number ⇒ Object
Returns season number.
-
#url ⇒ Object
Returns the value of attribute url.
Instance Method Summary collapse
-
#episode_count ⇒ Object
Returns numbers of episode.
-
#episode_ids ⇒ Object
Returns an Array of episode ids.
-
#episode_numbers ⇒ Object
Returns numbers of episode.
-
#initialize(id) ⇒ Season
constructor
A new instance of Season.
-
#serie ⇒ Object
Returns parent serie.
Constructor Details
#initialize(id) ⇒ Season
Returns a new instance of Season.
11 12 13 14 |
# File 'lib/allocine/season.rb', line 11 def initialize(id) @id = id @episodes = [] end |
Instance Attribute Details
#episodes ⇒ Object
Returns an Array of Allocine::Episode
42 43 44 |
# File 'lib/allocine/season.rb', line 42 def episodes @episodes end |
#id ⇒ Object
Returns the value of attribute id.
4 5 6 |
# File 'lib/allocine/season.rb', line 4 def id @id end |
#season_number ⇒ Object
Returns season number
22 23 24 |
# File 'lib/allocine/season.rb', line 22 def season_number @season_number end |
#url ⇒ Object
Returns the value of attribute url.
4 5 6 |
# File 'lib/allocine/season.rb', line 4 def url @url end |
Instance Method Details
#episode_count ⇒ Object
Returns numbers of episode
27 28 29 |
# File 'lib/allocine/season.rb', line 27 def episode_count document["episodeCount"] rescue nil end |
#episode_ids ⇒ Object
Returns an Array of episode ids
37 38 39 |
# File 'lib/allocine/season.rb', line 37 def episode_ids document["episode"].map { |episode| episode["code"]} rescue [] end |
#episode_numbers ⇒ Object
Returns numbers of episode
32 33 34 |
# File 'lib/allocine/season.rb', line 32 def episode_numbers document["episode"].size rescue nil end |