Skip to content

Instantly share code, notes, and snippets.

@Prigin
Created October 23, 2019 14:10
Show Gist options
  • Save Prigin/dd1ef9e0dac709d50bcc654da20b1e50 to your computer and use it in GitHub Desktop.
Save Prigin/dd1ef9e0dac709d50bcc654da20b1e50 to your computer and use it in GitHub Desktop.
task 5
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