Class: Filmtotaal::Movie
- Inherits:
-
Object
- Object
- Filmtotaal::Movie
- Defined in:
- lib/filmtotaal/movie.rb
Instance Attribute Summary collapse
-
#actors ⇒ Object
readonly
Returns the value of attribute actors.
-
#channel ⇒ Object
readonly
Returns the value of attribute channel.
-
#countries ⇒ Object
readonly
Returns the value of attribute countries.
-
#cover_url ⇒ Object
readonly
Returns the value of attribute cover_url.
-
#director ⇒ Object
readonly
Returns the value of attribute director.
-
#end_time ⇒ Object
readonly
Returns the value of attribute end_time.
-
#genres ⇒ Object
readonly
Returns the value of attribute genres.
-
#imdb_id ⇒ Object
readonly
Returns the value of attribute imdb_id.
-
#imdb_rating ⇒ Object
readonly
Returns the value of attribute imdb_rating.
-
#movie_tip ⇒ Object
readonly
Returns the value of attribute movie_tip.
-
#plot ⇒ Object
readonly
Returns the value of attribute plot.
-
#rating ⇒ Object
readonly
Returns the value of attribute rating.
-
#runtime ⇒ Object
readonly
Returns the value of attribute runtime.
-
#start_time ⇒ Object
readonly
Returns the value of attribute start_time.
-
#tagline ⇒ Object
readonly
Returns the value of attribute tagline.
-
#title ⇒ Object
readonly
Returns the value of attribute title.
-
#url ⇒ Object
readonly
Returns the value of attribute url.
-
#votes ⇒ Object
readonly
Returns the value of attribute votes.
-
#year ⇒ Object
readonly
Returns the value of attribute year.
Instance Method Summary collapse
-
#initialize(data, decoder) ⇒ Movie
constructor
A new instance of Movie.
Constructor Details
#initialize(data, decoder) ⇒ Movie
Returns a new instance of Movie.
4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/filmtotaal/movie.rb', line 4 def initialize(data, decoder) @title = decoder.decode(data.xpath('titel').text) @year = data.xpath('jaar').text.to_i @url = data.xpath('ft_link').text @director = decoder.decode(data.xpath('regisseur').text) @actors = decoder.decode(data.xpath('cast').text).split(':') @genres = decoder.decode(data.xpath('genres').text).split(':') @countries = decoder.decode(data.xpath('land').text).split(':') @plot = decoder.decode(data.xpath('synopsis').text) @tagline = decoder.decode(data.xpath('tagline').text) @rating = data.xpath('ft_rating').text.to_f @votes = data.xpath('ft_votes').text.to_i @imdb_id = "tt#{data.xpath('imdb_id').text}" @imdb_rating = data.xpath('imdb_rating').text.to_f @imdb_votes = data.xpath('imdb_votes').text.to_i @start_time = data.xpath('starttijd').text.to_i @end_time = data.xpath('eindtijd').text.to_i @runtime = data.xpath('duur').text.to_i @channel = decoder.decode(data.xpath('zender').text) @movie_tip = data.xpath('filmtip').text.to_i == 1 ? true : false @cover_url = data.xpath('cover').text end |
Instance Attribute Details
#actors ⇒ Object (readonly)
Returns the value of attribute actors.
3 4 5 |
# File 'lib/filmtotaal/movie.rb', line 3 def actors @actors end |
#channel ⇒ Object (readonly)
Returns the value of attribute channel.
3 4 5 |
# File 'lib/filmtotaal/movie.rb', line 3 def channel @channel end |
#countries ⇒ Object (readonly)
Returns the value of attribute countries.
3 4 5 |
# File 'lib/filmtotaal/movie.rb', line 3 def countries @countries end |
#cover_url ⇒ Object (readonly)
Returns the value of attribute cover_url.
3 4 5 |
# File 'lib/filmtotaal/movie.rb', line 3 def cover_url @cover_url end |
#director ⇒ Object (readonly)
Returns the value of attribute director.
3 4 5 |
# File 'lib/filmtotaal/movie.rb', line 3 def director @director end |
#end_time ⇒ Object (readonly)
Returns the value of attribute end_time.
3 4 5 |
# File 'lib/filmtotaal/movie.rb', line 3 def end_time @end_time end |
#genres ⇒ Object (readonly)
Returns the value of attribute genres.
3 4 5 |
# File 'lib/filmtotaal/movie.rb', line 3 def genres @genres end |
#imdb_id ⇒ Object (readonly)
Returns the value of attribute imdb_id.
3 4 5 |
# File 'lib/filmtotaal/movie.rb', line 3 def imdb_id @imdb_id end |
#imdb_rating ⇒ Object (readonly)
Returns the value of attribute imdb_rating.
3 4 5 |
# File 'lib/filmtotaal/movie.rb', line 3 def @imdb_rating end |
#movie_tip ⇒ Object (readonly)
Returns the value of attribute movie_tip.
3 4 5 |
# File 'lib/filmtotaal/movie.rb', line 3 def movie_tip @movie_tip end |
#plot ⇒ Object (readonly)
Returns the value of attribute plot.
3 4 5 |
# File 'lib/filmtotaal/movie.rb', line 3 def plot @plot end |
#rating ⇒ Object (readonly)
Returns the value of attribute rating.
3 4 5 |
# File 'lib/filmtotaal/movie.rb', line 3 def @rating end |
#runtime ⇒ Object (readonly)
Returns the value of attribute runtime.
3 4 5 |
# File 'lib/filmtotaal/movie.rb', line 3 def runtime @runtime end |
#start_time ⇒ Object (readonly)
Returns the value of attribute start_time.
3 4 5 |
# File 'lib/filmtotaal/movie.rb', line 3 def start_time @start_time end |
#tagline ⇒ Object (readonly)
Returns the value of attribute tagline.
3 4 5 |
# File 'lib/filmtotaal/movie.rb', line 3 def tagline @tagline end |
#title ⇒ Object (readonly)
Returns the value of attribute title.
3 4 5 |
# File 'lib/filmtotaal/movie.rb', line 3 def title @title end |
#url ⇒ Object (readonly)
Returns the value of attribute url.
3 4 5 |
# File 'lib/filmtotaal/movie.rb', line 3 def url @url end |
#votes ⇒ Object (readonly)
Returns the value of attribute votes.
3 4 5 |
# File 'lib/filmtotaal/movie.rb', line 3 def votes @votes end |
#year ⇒ Object (readonly)
Returns the value of attribute year.
3 4 5 |
# File 'lib/filmtotaal/movie.rb', line 3 def year @year end |