--- !ruby/object:RI::MethodDescription aliases: - !ruby/object:RI::AliasName name: redirect block_params: comment: - !ruby/struct:SM::Flow::P body: Redirect methods to other methods. This simply defines methods by the name of a hash key which calls the method with the name of the hash's value. - !ruby/struct:SM::Flow::VERB body: " class Example\n redirect_method :hi => :hello, :hey => :hello\n def hello(name)\n puts "Hello, #{name}."\n end\n end\n\n e = Example.new\n e.hello("Bob") #=> "Hello, Bob."\n e.hi("Bob") #=> "Hello, Bob."\n e.hey("Bob") #=> "Hello, Bob."\n" - !ruby/struct:SM::Flow::P body: "The above class definition is equivalent to:" - !ruby/struct:SM::Flow::VERB body: " class Example\n def hi(*args)\n hello(*args)\n end\n def hey(*args)\n hello(*args)\n end\n def hello\n puts "Hello"\n end\n end\n" - !ruby/struct:SM::Flow::P body: "CREDIT: Trans" full_name: Module#redirect_method is_singleton: false name: redirect_method params: ( method_hash ) visibility: private