Class: Allocine::Episode

Inherits:
Object
  • Object
show all
Defined in:
lib/allocine/episode.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(allocine_id) ⇒ Episode

Returns a new instance of Episode.



11
12
13
# File 'lib/allocine/episode.rb', line 11

def initialize(allocine_id)
  @id = allocine_id
end

Instance Attribute Details

#numberObject

Represent an Episode on Allocine website s = Allocine::Episode.new(233014) e = s.title



9
10
11
# File 'lib/allocine/episode.rb', line 9

def number
  @number
end

#release_dateObject

Represent an Episode on Allocine website s = Allocine::Episode.new(233014) e = s.title



9
10
11
# File 'lib/allocine/episode.rb', line 9

def release_date
  @release_date
end

#synopsisObject

Represent an Episode on Allocine website s = Allocine::Episode.new(233014) e = s.title



9
10
11
# File 'lib/allocine/episode.rb', line 9

def synopsis
  @synopsis
end

#titleObject

Returns the title



9
10
11
# File 'lib/allocine/episode.rb', line 9

def title
  @title
end

Instance Method Details

#episode_number_seasonObject



49
50
51
# File 'lib/allocine/episode.rb', line 49

def episode_number_season
  document["episodeNumberSeason"]
end

#episode_number_seriesObject



45
46
47
# File 'lib/allocine/episode.rb', line 45

def episode_number_series
  document["episodeNumberSeries"]
end

#original_broadcast_dateObject

Returns the broadcast date



36
37
38
# File 'lib/allocine/episode.rb', line 36

def original_broadcast_date
  document["originalBroadcastDate"] rescue nil
end

#original_titleObject

Returns the original title



31
32
33
# File 'lib/allocine/episode.rb', line 31

def original_title
  document["originalTitle"] rescue nil
end

#plot(short = true) ⇒ Object

Returns the plot



41
42
43
# File 'lib/allocine/episode.rb', line 41

def plot(short = true)
  short == true ? document["synopsisShort"] : document["synopsis"] 
end

#seasonObject

Returns the season parent



16
17
18
# File 'lib/allocine/episode.rb', line 16

def season
  Allocine::Season.new(document["parentSeason"]["code"])
end

#serieObject

Returns the serie parent



21
22
23
# File 'lib/allocine/episode.rb', line 21

def serie
  Allocine::Serie.new(document["parentSeries"]["code"])
end