Class: HammerCLI::CompleterLine

Inherits:
Array
  • Object
show all
Defined in:
lib/hammer_cli/completer.rb

Overview

Array of command line words for completion. Splits string line to “words” with trailing spaces. –param?[ ]* or -flag[ ]* or [‘“]word?[ ]*

Instance Method Summary collapse

Constructor Details

#initialize(line) ⇒ CompleterLine

Returns a new instance of CompleterLine.



45
46
47
48
# File 'lib/hammer_cli/completer.rb', line 45

def initialize(line)
  @line = line
  super(split_line)
end

Instance Method Details

#complete?Boolean

Returns:

  • (Boolean)


50
51
52
# File 'lib/hammer_cli/completer.rb', line 50

def complete?
  self.empty? || self.last.complete?
end