Created
August 15, 2016 14:14
-
-
Save maxehmookau/3078faa90506ca6e5c94e5a202326d42 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 Film | |
attr_reader :title | |
def initialize(title) | |
@title = title | |
end | |
end |
This file contains hidden or 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
require_relative 'film' | |
films = [ | |
Film.new('Harry Potter'), | |
Film.new('X-Men'), | |
Film.new('Finding Nemo') | |
] | |
puts "#{films.sample.title} and #{films.sample.title} are great films!" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment