Skip to content

Instantly share code, notes, and snippets.

@ngpestelos
Created September 29, 2013 03:54
Show Gist options
  • Save ngpestelos/6749223 to your computer and use it in GitHub Desktop.
Save ngpestelos/6749223 to your computer and use it in GitHub Desktop.
class macro
class C; end
class << C
def my_macro(arg)
"my_macro(#{arg}) called"
end
end
class C
my_macro :x # my_macro(x) called
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment