Class: ArgumentsParser
Class Method Summary collapse
Class Method Details
.parse_arguments_for(method, *args, &block) ⇒ Object
13 14 15 16 17 18 19 20 21 |
# File 'lib/ruby_ext/prepare_arguments.rb', line 13 def parse_arguments_for method, *args, &block = @registry[method] index = 0 parsed_args = .collect do || send [:type], args, block, , index, (index == .size - 1) end args.must_be.empty return parsed_args end |
.register(method, arguments) ⇒ Object
3 4 5 6 7 8 9 10 11 |
# File 'lib/ruby_ext/prepare_arguments.rb', line 3 def register method, arguments # check and prepare metadata arguments.collect!{|| .is_a?(Hash) ? : {:type => }} arguments.each{|| .must.include :type} # register @registry ||= {} @registry[method] = arguments end |