Created
January 3, 2020 09:28
-
-
Save kamipo/8c251dfd2c43d2a0c98593b1e7c8223e to your computer and use it in GitHub Desktop.
This file contains hidden or 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
class Foo | |
def initialize(target) | |
@target = target | |
end | |
if RUBY_VERSION > "2.7" | |
def method_missing(method, *args, **kwargs, &block) | |
@target.send(method, *args, **kwargs, &block) | |
end | |
else | |
def method_missing(method, *args, &block) | |
@target.send(method, *args, &block) | |
end | |
ruby2_keywords(:method_missing) if respond_to?(:ruby2_keywords, true) | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment