Class: ArgvParser::UnnamedOption

Inherits:
Object
  • Object
show all
Defined in:
lib/ruby-process-controller/argv_parser.rb

Direct Known Subclasses

Option

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(option_name, value_is_optional, value_may_be_array, comment, conditions, block) ⇒ UnnamedOption

Returns a new instance of UnnamedOption.



22
23
24
25
26
27
28
29
# File 'lib/ruby-process-controller/argv_parser.rb', line 22

def initialize option_name, value_is_optional, value_may_be_array, comment, conditions, block
  @option_name = option_name
  @value_is_optional = value_is_optional
  @value_may_be_array = value_may_be_array
  @comment = comment
  @conditions = conditions
  @block = block
end

Instance Attribute Details

#blockObject

Returns the value of attribute block.



31
32
33
# File 'lib/ruby-process-controller/argv_parser.rb', line 31

def block
  @block
end

#commentObject

Returns the value of attribute comment.



31
32
33
# File 'lib/ruby-process-controller/argv_parser.rb', line 31

def comment
  @comment
end

#conditionsObject

Returns the value of attribute conditions.



31
32
33
# File 'lib/ruby-process-controller/argv_parser.rb', line 31

def conditions
  @conditions
end

#option_is_booleanObject

Returns the value of attribute option_is_boolean.



32
33
34
# File 'lib/ruby-process-controller/argv_parser.rb', line 32

def option_is_boolean
  @option_is_boolean
end

#option_nameObject

Returns the value of attribute option_name.



31
32
33
# File 'lib/ruby-process-controller/argv_parser.rb', line 31

def option_name
  @option_name
end

#short_option_nameObject

Returns the value of attribute short_option_name.



32
33
34
# File 'lib/ruby-process-controller/argv_parser.rb', line 32

def short_option_name
  @short_option_name
end

#value_is_optionalObject

Returns the value of attribute value_is_optional.



31
32
33
# File 'lib/ruby-process-controller/argv_parser.rb', line 31

def value_is_optional
  @value_is_optional
end

#value_may_be_arrayObject

Returns the value of attribute value_may_be_array.



31
32
33
# File 'lib/ruby-process-controller/argv_parser.rb', line 31

def value_may_be_array
  @value_may_be_array
end

#value_nameObject

Returns the value of attribute value_name.



32
33
34
# File 'lib/ruby-process-controller/argv_parser.rb', line 32

def value_name
  @value_name
end

Instance Method Details

#columnized_displayObject



38
39
40
# File 'lib/ruby-process-controller/argv_parser.rb', line 38

def columnized_display
  [display, comment]
end

#displayObject



34
35
36
# File 'lib/ruby-process-controller/argv_parser.rb', line 34

def display
  "#{"[" if value_is_optional}#{option_name}#{"]" if value_is_optional}#{"..." if value_may_be_array}"
end