Object#method.call
method(:関数名).call(引数)とシンボルで渡すものだと思ってたけど、stringで関数名を渡してもいけた
> o = Object.new => #<Object:0x1cea8f0> >> o.methods => ["inspect", "pretty_print_inspect", "to_yaml", "taguri=", "clone", "method", "public_methods", "instance_variable_defined?", "equal?", "freeze", "to_yaml_properties", "to_yaml_style", "methods", "respond_to?", "dup", "instance_variables", "__id__", "object_id", "eql?", "pretty_print_instance_variables", "id", "pretty_print_cycle", "singleton_methods", "send", "taint", "frozen?", "instance_variable_get", "__send__", "instance_of?", "to_a", "type", "pretty_inspect", "dclone", "protected_methods", "instance_eval", "pretty_print", "==", "display", "===", "instance_variable_set", "kind_of?", "extend", "to_s", "hash", "class", "private_methods", "=~", "tainted?", "untaint", "nil?", "is_a?", "taguri"] >> o.hash => 15160440 >> o.method(:hash) => #<Method: Object(Kernel)#hash> >> o.method(:hash).call => 15160440 >> o.method(hash).call (irb):80: warning: do not use Fixnums as Symbols ArgumentError: 113870 is not a symbol from (irb):80:in `method' from (irb):80 >> o.method("hash").call => 15160440 >> o.method(":hash").call NameError: undefined method `:hash' for class `Object' from (irb):82:in `method' from (irb):82 >> o.method(:"hash").call => 15160440 >> o.method("hash".to_sym).call => 15160440 >> o.method(:hash.to_s).call => 15160440