On Oct 26, 9:29 ¨Βν¬ ΝαγαςιΟςτεηα Όναγα®®®ΐηναιμ®γονχςοτεΊ > Hi, I've written a small gem to pass named arguments to an existing > method using ruby2ruby. Here's the usage: > > require 'named_arguments' > > class Example > def instance_method(uno = 1, dos = 2, tres = 3, cuatro = 4) > [uno, dos, tres, cuatro] > end > > def another_instance_method( a = :a, b = :b, c = :c) > [a,b,c] > end > > named_args_for :instance_method, :another_instance_method > > class << self > def class_method(uno = 1, dos = 2, tres = 3, cuatro = 4) > [uno, dos, tres, cuatro] > end > named_args_for :class_method > end > end > > Example.new.instance_method( :one, :dos => :two, :tres => :three ) > => [:one,:two,:three,4] > > Example.new.another_instance_method > => [:a,:b,:c] > > Example.class_method( :dos => :b, :cuatro => :d ) > => [1,:b,2,:d] > > http://github.com/maca/namedarguments/tree/master/ > -- > Posted viahttp://www.ruby-forum.com/. Hm, using your example with named_arguments 0.0.5 I get: undefined method `named_args_for' for Example:Class (NoMethodError) Regards, Dan