-
-
Save pmarreck/6227c14e6f631e6944d7 to your computer and use it in GitHub Desktop.
Ruby binding madness
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# When I try this piece of code... | |
cm = 'some_class_method' | |
klass.class_eval do | |
class << klass | |
define_method(cm) do |*args, &block| | |
# ...I get an error 'undefined local variable or method `cm' for #<Class:Fixnum> (NameError)' | |
# How do I get that context to see the cm variable? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment