Heads up! To view this whole video, sign in with your Courses account or enroll in your free 7-day trial. Sign In Enroll
Well done!
You have completed Ruby Objects and Classes!
You have completed Ruby Objects and Classes!
Preview
Ruby gives us shortcuts to write common pieces of code. The process of accessing and writing attributes in a class can be done using `attr_writer` and `attr_accessor` to ease repeating code.
This video doesn't have any notes.
Related Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign upRelated Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign up
Let's take a look at how those work now,
using workspaces.
0:00
Now Ruby gives us some other methods like
attr_reader, that we can use in our code.
0:04
And let's go ahead and see how this works
right now.
0:10
If I open up IRB, I can load in this file
to work with,
0:13
by typing the word load and the name of
the file.
0:19
And what that will do, will be to load
this class into our IRB session.
0:23
You need to sign up for Treehouse in order to download course files.
Sign upYou need to sign up for Treehouse in order to set up Workspace
Sign up