Skip to content

Instantly share code, notes, and snippets.

@dissolved
Created October 12, 2013 03:10
Show Gist options
  • Save dissolved/6945327 to your computer and use it in GitHub Desktop.
Save dissolved/6945327 to your computer and use it in GitHub Desktop.
Why Arlington Ruby is so great!
[5:08pm] allie_p: is an instance variable and an instance method the same thing?
[5:09pm] saturnflyer: no
[5:09pm] saturnflyer: an instance variable is some internal value
[5:09pm] saturnflyer: an instance method is some function that object can perform
[5:10pm] allie_p: ok, so they're related but different
[5:10pm] saturnflyer: typically, you might keep the names the same to set and retrieve the instance variable values
[5:10pm] saturnflyer: attr_accessor creates 2 methods that set and retrieve the instance variable
[5:10pm] saturnflyer: but you could have a method called full_name, that returns something other than @full_name
[5:11pm] saturnflyer: it could be @__full_person_name, or whatever you want
[5:15pm] allie_p: thanks!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment