Created
October 23, 2019 14:10
-
-
Save Prigin/dd1ef9e0dac709d50bcc654da20b1e50 to your computer and use it in GitHub Desktop.
task 5
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_accessor :link, :title, :year, :country, :date, | |
:genre, :duration,:rating, :director, :stars | |
def initialize (link=nil, title=nil, year=nil, country=nil, date=nil, genre=nil, duration=nil, rating=nil, director=nil, stars=nil) | |
@link = link | |
@title = title | |
@year = year | |
@country = country | |
@date = date | |
@genre = genre.split(",").sort | |
@duration = duration | |
@rating = rating | |
@director = director.split(",").sort | |
@stars = stars.split(",").sort | |
end | |
def has_genre?(unit) | |
if @genre.include?(unit) | |
return true | |
else | |
return false | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment