Attribute Readers1:46 with Jason Seifer
An attribute reader allows us to access variables in a class from outside that class. This is normally code we would have to write ourselves but Ruby gives us a shortcut in the form of an attribute reader.
class Name attr_reader :first_name, :middle_name, :last_name def initialize(title, first_name, middle_name, last_name) @title = title @first_name = first_name @midde_name = middle_name @last_name = last_name end end
You need to sign up for Treehouse in order to download course files.Sign up