Class: Ame::Splus

Inherits:
Argument show all
Defined in:
lib/ame-1.0/splus.rb

Overview

Represents a splus argument to a Method, which works just like a normal Argument, except that it’ll process all remaining arguments.

Direct Known Subclasses

Splat

Instance Attribute Summary

Attributes inherited from Argument

#description, #name

Instance Method Summary collapse

Methods inherited from Argument

#initialize, #to_s

Constructor Details

This class inherits a constructor from Ame::Argument

Instance Method Details

#process(options, processed, arguments) ⇒ Array<Object>

Processes each argument in ARGUMENTS via Argument#process.

Parameters:

  • options (Hash<String, Object>)
  • processed (Array<String>)
  • arguments (Array<String>)

Returns:

  • (Array<Object>)

Raises:



14
15
16
17
18
19
20
21
# File 'lib/ame-1.0/splus.rb', line 14

def process(options, processed, arguments)
  super options, processed, arguments if arguments.empty?
  [].tap{ |r|
    until arguments.empty?
      r << super(options, processed, arguments)
    end
  }
end