Class: Toys::Flag::DefaultCompletion

Inherits:
Completion::Base show all
Defined in:
core-docs/toys/flag.rb

Overview

A Completion that returns all possible flags associated with a Toys::Flag.

Defined in the toys-core gem

Instance Method Summary collapse

Constructor Details

#initialize(flag:, include_short: true, include_long: true, include_negative: true) ⇒ DefaultCompletion

Create a completion given configuration options.

Parameters:

  • flag (Toys::Flag) —

    The flag definition.

  • include_short (boolean) (defaults to: true) —

    Whether to include short flags.

  • include_long (boolean) (defaults to: true) —

    Whether to include long flags.

  • include_negative (boolean) (defaults to: true) —

    Whether to include --no-* forms.



220
221
222
# File 'core-docs/toys/flag.rb', line 220

def initialize(flag:, include_short: true, include_long: true, include_negative: true)
  # Source available in the toys-core gem
end

Instance Method Details

#call(context) ⇒ Array<Toys::Completion::Candidate>

Returns candidates for the current completion.

Parameters:

Returns:



255
256
257
# File 'core-docs/toys/flag.rb', line 255

def call(context)
  # Source available in the toys-core gem
end

#include_long? ⇒ boolean

Whether to include long flags

Returns:

  • (boolean)


236
237
238
# File 'core-docs/toys/flag.rb', line 236

def include_long?
  # Source available in the toys-core gem
end

#include_negative? ⇒ boolean

Whether to include negative long flags

Returns:

  • (boolean)


244
245
246
# File 'core-docs/toys/flag.rb', line 244

def include_negative?
  # Source available in the toys-core gem
end

#include_short? ⇒ boolean

Whether to include short flags

Returns:

  • (boolean)


228
229
230
# File 'core-docs/toys/flag.rb', line 228

def include_short?
  # Source available in the toys-core gem
end