Skip to content

Instantly share code, notes, and snippets.

@eliavlavi
Last active September 8, 2017 14:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save eliavlavi/3d268cc5047fb812415847a1824f20b9 to your computer and use it in GitHub Desktop.
Save eliavlavi/3d268cc5047fb812415847a1824f20b9 to your computer and use it in GitHub Desktop.
Movie class
class Movie
attr_reader :imdb_score, :rotten_tomatoes_score
def initialize(name, imdb_score, rotten_tomatoes_score)
@name = name
@imdb_score = imdb_score
@rotten_tomatoes_score = rotten_tomatoes_score
end
def average_score
(@imdb_score + @rotten_tomatoes_score) / 2
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment