Class: GLI::Argument

Inherits:
Object
  • Object
show all
Defined in:
lib/gli/argument.rb

Overview

:nodoc:

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, options = []) ⇒ Argument

Returns a new instance of Argument.



7
8
9
10
# File 'lib/gli/argument.rb', line 7

def initialize(name,options = [])
  @name = name
  @options = options
end

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



4
5
6
# File 'lib/gli/argument.rb', line 4

def name
  @name
end

#optionsObject (readonly)

Returns the value of attribute options.



5
6
7
# File 'lib/gli/argument.rb', line 5

def options
  @options
end

Instance Method Details

#multiple?Boolean

Returns:

  • (Boolean)


16
17
18
# File 'lib/gli/argument.rb', line 16

def multiple?
  @options.include? :multiple
end

#optional?Boolean

Returns:

  • (Boolean)


12
13
14
# File 'lib/gli/argument.rb', line 12

def optional?
  @options.include? :optional
end