-
-
Save eliavlavi/3d268cc5047fb812415847a1824f20b9 to your computer and use it in GitHub Desktop.
Movie class
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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