Skip to content

Instantly share code, notes, and snippets.

@brianstorti
Created November 15, 2011 02:00
Show Gist options
  • Save brianstorti/1365895 to your computer and use it in GitHub Desktop.
Save brianstorti/1365895 to your computer and use it in GitHub Desktop.
this_var
class Class
def method_missing(name, *args)
name = name.to_s
if name =~ /this/
name["this_"] = ""
eval("@#{name}")
end
end
end
class A
@var = "abc"
def self.test
this_var
end
end
puts A.test
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment