Skip to content

Instantly share code, notes, and snippets.

@descentintomael
Created July 25, 2014 21:38
Show Gist options
  • Save descentintomael/a22931d3254263668b8d to your computer and use it in GitHub Desktop.
Save descentintomael/a22931d3254263668b8d to your computer and use it in GitHub Desktop.
sub-method demo
class A
def a
1
end
def b
def a
3
end
'done'
end
end
obj = A.new
puts obj.a # => 1
obj.b
puts obj.a # => 3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment