Skip to content

Instantly share code, notes, and snippets.

@endash
Created July 29, 2013 23:15
Show Gist options
  • Save endash/6108744 to your computer and use it in GitHub Desktop.
Save endash/6108744 to your computer and use it in GitHub Desktop.
class Test
def test=(test)
@test = test
end
def test
@test
end
def test2
test = "hello!"
end
end
a = Test.new
a.test #nil
a.test = "bob" #bob
a.test2 -> returns "hello!"
a.test => "bob"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment