Last active
August 29, 2015 14:01
-
-
Save murajun1978/4d36f5e8784be1576a6d 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 | |
| private_class_method def self.common_method(*syms) | |
| syms.each do |sym| | |
| define_method sym do | |
| puts sym | |
| end | |
| end | |
| end | |
| common_method :murajun, :murajun1978 | |
| end | |
| Foo.new.murajun # => murajun | |
| Foo.new.murajun1978 # => murajun1978 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment