Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
ClassMacro1
class Foo
def self.foo(method)
define_method(method) do
puts "Foo##{method} called."
end
end
foo :bar
foo :baz
end
Foo.new.bar #=> Foo#bar called.
Foo.new.baz #=> Foo#baz called.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.