Class: Lotr::Sdk::Movie

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

Overview

Movie represents the data of a movie.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(data) ⇒ Movie

Returns a new instance of Movie.



9
10
11
12
# File 'lib/lotr/sdk/movie.rb', line 9

def initialize(data)
  @data = data
  @quotes = []
end

Instance Attribute Details

#dataObject (readonly)

Returns the value of attribute data.



7
8
9
# File 'lib/lotr/sdk/movie.rb', line 7

def data
  @data
end

#quotesObject (readonly)

Returns the value of attribute quotes.



7
8
9
# File 'lib/lotr/sdk/movie.rb', line 7

def quotes
  @quotes
end

Instance Method Details

#academy_award_nominationsInteger

Represents the number of Academy Award nominations

Returns:

  • (Integer)


46
47
48
# File 'lib/lotr/sdk/movie.rb', line 46

def academy_award_nominations
  @data["academyAwardNominations"]
end

#academy_award_winsInteger

Represents the number of Academy Awards won

Returns:

  • (Integer)


52
53
54
# File 'lib/lotr/sdk/movie.rb', line 52

def academy_award_wins
  @data["academyAwardWins"]
end

#budget_millionsInteger

Represents the movie budget in milions

Returns:

  • (Integer)


34
35
36
# File 'lib/lotr/sdk/movie.rb', line 34

def budget_millions
  @data["budgetInMillions"]
end

#idString

Represents the movie ID

Returns:

  • (String)


16
17
18
# File 'lib/lotr/sdk/movie.rb', line 16

def id
  @data["_id"]
end

#nameString

Represents the movie title

Returns:

  • (String)


22
23
24
# File 'lib/lotr/sdk/movie.rb', line 22

def name
  @data["name"]
end

#revenue_millionsInteger

Represents the movie revenue in milions

Returns:

  • (Integer)


40
41
42
# File 'lib/lotr/sdk/movie.rb', line 40

def revenue_millions
  @data["boxOfficeRevenueInMillions"]
end

#rotten_tomatoes_scoreInteger

Represents the score out of 100 on Rotten Tomatoes

Returns:

  • (Integer)


58
59
60
# File 'lib/lotr/sdk/movie.rb', line 58

def rotten_tomatoes_score
  @data["rottenTomatoesScore"]
end

#run_time_minutes(format: false) ⇒ Integer

Represents the movie length

Returns:

  • (Integer)


28
29
30
# File 'lib/lotr/sdk/movie.rb', line 28

def run_time_minutes(format: false)
  @data["runtimeInMinutes"]
end