Skip to content

Instantly share code, notes, and snippets.

@nmk
Created November 21, 2013 15:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nmk/7583162 to your computer and use it in GitHub Desktop.
Save nmk/7583162 to your computer and use it in GitHub Desktop.
class Foo
attr_accessor :n
def initialize(i)
@n = i
end
def val
n
end
def bump!
n += 1
end
end
f = Foo.new(0)
puts f.val
f.bump!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment