Class: Rubikon::Flag

Inherits:
Object show all
Includes:
Parameter
Defined in:
lib/rubikon/flag.rb

Overview

A flag is an application parameter without arguments

See Also:

Author:

  • Sebastian Staudt

Since:

  • 0.3.0

Instance Attribute Summary

Attributes included from Parameter

#aliases, #description, #name

Instance Method Summary collapse

Methods included from Parameter

#active?, #initialize

Instance Method Details

#<<(arg) ⇒ Object (private)

Adds an argument to this flag

Raises:

Since:

  • 0.3.0



28
29
30
# File 'lib/rubikon/flag.rb', line 28

def <<(arg)
  raise ExtraArgumentError.new(@name)
end

#args_full?true (private)

Checks whether this flag has all required arguments supplied

Returns:

  • (true)

    This is always true because flags never take any arguments.

Since:

  • 0.3.0



36
37
38
# File 'lib/rubikon/flag.rb', line 36

def args_full?
  true
end

#more_args?false (private)

Checks whether this flag can take more arguments

Returns:

  • (false)

    This is always false because flags never take any arguments.

Since:

  • 0.3.0



44
45
46
# File 'lib/rubikon/flag.rb', line 44

def more_args?
  false
end