Class: Ame::Arguments::Complete

Inherits:
Undefined show all
Defined in:
lib/ame-1.0/arguments/complete.rb

Overview

The arguments to a method in its undefined state where a splat or splus has been added and thus no further arguments are allowed.

Instance Method Summary collapse

Methods inherited from Undefined

#define, #empty?

Constructor Details

#initialize(arguments, splat_command, splat) ⇒ Complete

Returns a new instance of Complete.



7
8
9
# File 'lib/ame-1.0/arguments/complete.rb', line 7

def initialize(arguments, splat_command, splat)
  @arguments, @splat_command, @splat = arguments + [splat], splat_command, splat
end

Instance Method Details

#argument(name, type, description, &validate) ⇒ Object

Raises:

  • (ArgumentError)

    If a splat or splus argument has been defined



12
13
14
# File 'lib/ame-1.0/arguments/complete.rb', line 12

def argument(name, type, description, &validate)
  error 'argument', name
end

#optional(name, default, description, &validate) ⇒ Object

Raises:

  • (ArgumentError)

    If a splat or splus argument has been defined



17
18
19
# File 'lib/ame-1.0/arguments/complete.rb', line 17

def optional(name, default, description, &validate)
  error 'optional', name
end

#splat(name, type, description, &validate) ⇒ Object

Raises:

  • (ArgumentError)

    If a splat or splus argument has been defined



22
23
24
# File 'lib/ame-1.0/arguments/complete.rb', line 22

def splat(name, type, description, &validate)
  error 'splat', name
end

#splus(name, type, description, &validate) ⇒ Object

Raises:

  • (ArgumentError)

    If a splat or splus argument has been defined



27
28
29
# File 'lib/ame-1.0/arguments/complete.rb', line 27

def splus(name, type, description, &validate)
  error 'splus', name
end