Skip to content

Instantly share code, notes, and snippets.

@murajun1978
Last active August 29, 2015 14:01
Show Gist options
  • Save murajun1978/4d36f5e8784be1576a6d to your computer and use it in GitHub Desktop.
Save murajun1978/4d36f5e8784be1576a6d to your computer and use it in GitHub Desktop.
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