Skip to content

Instantly share code, notes, and snippets.

@anthonygharvey
Last active March 6, 2019 01:19
Show Gist options
  • Save anthonygharvey/9ec208fa2faacb28945e86f87a84c95f to your computer and use it in GitHub Desktop.
Save anthonygharvey/9ec208fa2faacb28945e86f87a84c95f to your computer and use it in GitHub Desktop.
a `Movie` class with several attributes and functionality to only update a movie’s title if the `in_progress` attribute is `true`
class Movie
attr_accessor :in_progress
attr_reader :title, :length, :budget
def title=(new_title)
if @in_progress
@title = new_title
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment