Class: Filmtotaal::Movie

Inherits:
Object
  • Object
show all
Defined in:
lib/filmtotaal/movie.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#actorsObject (readonly)

Returns the value of attribute actors.



3
4
5
# File 'lib/filmtotaal/movie.rb', line 3

def actors
  @actors
end

#channelObject (readonly)

Returns the value of attribute channel.



3
4
5
# File 'lib/filmtotaal/movie.rb', line 3

def channel
  @channel
end

#countriesObject (readonly)

Returns the value of attribute countries.



3
4
5
# File 'lib/filmtotaal/movie.rb', line 3

def countries
  @countries
end

#cover_urlObject (readonly)

Returns the value of attribute cover_url.



3
4
5
# File 'lib/filmtotaal/movie.rb', line 3

def cover_url
  @cover_url
end

#directorObject (readonly)

Returns the value of attribute director.



3
4
5
# File 'lib/filmtotaal/movie.rb', line 3

def director
  @director
end

#end_timeObject (readonly)

Returns the value of attribute end_time.



3
4
5
# File 'lib/filmtotaal/movie.rb', line 3

def end_time
  @end_time
end

#genresObject (readonly)

Returns the value of attribute genres.



3
4
5
# File 'lib/filmtotaal/movie.rb', line 3

def genres
  @genres
end

#imdb_idObject (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_ratingObject (readonly)

Returns the value of attribute imdb_rating.



3
4
5
# File 'lib/filmtotaal/movie.rb', line 3

def imdb_rating
  @imdb_rating
end

#movie_tipObject (readonly)

Returns the value of attribute movie_tip.



3
4
5
# File 'lib/filmtotaal/movie.rb', line 3

def movie_tip
  @movie_tip
end

#plotObject (readonly)

Returns the value of attribute plot.



3
4
5
# File 'lib/filmtotaal/movie.rb', line 3

def plot
  @plot
end

#ratingObject (readonly)

Returns the value of attribute rating.



3
4
5
# File 'lib/filmtotaal/movie.rb', line 3

def rating
  @rating
end

#runtimeObject (readonly)

Returns the value of attribute runtime.



3
4
5
# File 'lib/filmtotaal/movie.rb', line 3

def runtime
  @runtime
end

#start_timeObject (readonly)

Returns the value of attribute start_time.



3
4
5
# File 'lib/filmtotaal/movie.rb', line 3

def start_time
  @start_time
end

#taglineObject (readonly)

Returns the value of attribute tagline.



3
4
5
# File 'lib/filmtotaal/movie.rb', line 3

def tagline
  @tagline
end

#titleObject (readonly)

Returns the value of attribute title.



3
4
5
# File 'lib/filmtotaal/movie.rb', line 3

def title
  @title
end

#urlObject (readonly)

Returns the value of attribute url.



3
4
5
# File 'lib/filmtotaal/movie.rb', line 3

def url
  @url
end

#votesObject (readonly)

Returns the value of attribute votes.



3
4
5
# File 'lib/filmtotaal/movie.rb', line 3

def votes
  @votes
end

#yearObject (readonly)

Returns the value of attribute year.



3
4
5
# File 'lib/filmtotaal/movie.rb', line 3

def year
  @year
end