Skip to content

Instantly share code, notes, and snippets.

@leomayleomay
Created October 22, 2009 01:08
Show Gist options
  • Save leomayleomay/215635 to your computer and use it in GitHub Desktop.
Save leomayleomay/215635 to your computer and use it in GitHub Desktop.
class A
a = 1
end
how could I get the value of a outside of class A?
A.send(:local_variables)
=> ["_"]
there's no local variables named a in the class A.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment