Class: FilmBuff::Title

Inherits:
Object
  • Object
show all
Defined in:
lib/filmbuff/title.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ Title

Returns a new instance of Title.



6
7
8
9
10
11
12
13
14
15
16
17
18
# File 'lib/filmbuff/title.rb', line 6

def initialize(options = {})
  @imdb_id = options["tconst"]
  @title = options["title"]
  @tagline = options["tagline"]
  @plot = options["plot"]["outline"] if options["plot"]
  @runtime = options["runtime"]["time"] if options["runtime"]
  @rating = options["rating"]
  @votes = options["num_votes"]
  @poster_url = options["image"]["url"] if options["image"]
  @genres = options["genres"] || []
  @release_date = options["release_date"]["normal"] if
    options["release_date"]["normal"]
end

Instance Attribute Details

#genresObject (readonly)

Returns the value of attribute genres.



3
4
5
# File 'lib/filmbuff/title.rb', line 3

def genres
  @genres
end

#imdb_idObject (readonly)

Returns the value of attribute imdb_id.



3
4
5
# File 'lib/filmbuff/title.rb', line 3

def imdb_id
  @imdb_id
end

#plotObject (readonly)

Returns the value of attribute plot.



3
4
5
# File 'lib/filmbuff/title.rb', line 3

def plot
  @plot
end

#poster_urlObject (readonly)

Returns the value of attribute poster_url.



3
4
5
# File 'lib/filmbuff/title.rb', line 3

def poster_url
  @poster_url
end

#ratingObject (readonly)

Returns the value of attribute rating.



3
4
5
# File 'lib/filmbuff/title.rb', line 3

def rating
  @rating
end

#release_dateObject (readonly)

Returns the value of attribute release_date.



3
4
5
# File 'lib/filmbuff/title.rb', line 3

def release_date
  @release_date
end

#runtimeObject (readonly)

Returns the value of attribute runtime.



3
4
5
# File 'lib/filmbuff/title.rb', line 3

def runtime
  @runtime
end

#taglineObject (readonly)

Returns the value of attribute tagline.



3
4
5
# File 'lib/filmbuff/title.rb', line 3

def tagline
  @tagline
end

#titleObject (readonly)

Returns the value of attribute title.



3
4
5
# File 'lib/filmbuff/title.rb', line 3

def title
  @title
end

#votesObject (readonly)

Returns the value of attribute votes.



3
4
5
# File 'lib/filmbuff/title.rb', line 3

def votes
  @votes
end