Class: Ame::Splat

Inherits:
Argument show all
Defined in:
lib/ame/splat.rb

Instance Attribute Summary

Attributes inherited from Argument

#default, #description, #name

Instance Method Summary collapse

Methods inherited from Argument

#initialize, #optional?, #required?, #to_s

Constructor Details

This class inherits a constructor from Ame::Argument

Instance Method Details

#arityObject



4
5
6
# File 'lib/ame/splat.rb', line 4

def arity
  -1
end

#process(options, processed, arguments) ⇒ Object



8
9
10
11
# File 'lib/ame/splat.rb', line 8

def process(options, processed, arguments)
  super options, processed, nil if required? and arguments.empty?
  arguments.map{ |argument| super(options, processed, argument) }.tap{ arguments.clear }
end