Skip to content

Instantly share code, notes, and snippets.

@jheg
Created November 17, 2014 11:03
Show Gist options
  • Save jheg/61e2961150e564d92ca3 to your computer and use it in GitHub Desktop.
Save jheg/61e2961150e564d92ca3 to your computer and use it in GitHub Desktop.
getters and setters
# how does this differ from ...
def name=(new_name)
@name = new_name
end
object.name("Bob")
# this
def name(new_name)
@name = new_name
end
object.name = "Bob"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment