Class: Commands::FlagOption

Inherits:
CommandOption show all
Defined in:
lib/commands.rb

Instance Attribute Summary

Attributes inherited from CommandOption

#arg, #commands, #description, #name, #parent_commands

Instance Method Summary collapse

Constructor Details

#initialize(name, description, arg, parent_commands, commands, field_symbol) ⇒ FlagOption

Returns a new instance of FlagOption.


1270
1271
1272
1273
# File 'lib/commands.rb', line 1270

def initialize(name, description, arg, parent_commands, commands, field_symbol)
  super(name, description, arg, parent_commands, commands)
  @field_symbol = field_symbol
end

Instance Method Details

#attach(commands) ⇒ Object


1275
1276
1277
1278
# File 'lib/commands.rb', line 1275

def attach(commands)
  command = super(commands)
  command.option(@name, @field_symbol, true)
end