Class: TTY2::Reader::CompletionEvent

Inherits:
Object
  • Object
show all
Defined in:
lib/tty2/reader/completion_event.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(completer, completion, line) ⇒ CompletionEvent

Create a CompletionEvent

Parameters:

  • completer (Completer)

    the word completer

  • completion (String)

    the word completion

  • line (String)

    the line with the word to complete



28
29
30
31
32
33
# File 'lib/tty2/reader/completion_event.rb', line 28

def initialize(completer, completion, line)
  @completion = completion
  @completions = completer.completions.to_a
  @line = line
  @word = completer.word
end

Instance Attribute Details

#completionObject (readonly)

The suggested word completion



7
8
9
# File 'lib/tty2/reader/completion_event.rb', line 7

def completion
  @completion
end

#completionsObject (readonly)

The completion suggestions



10
11
12
# File 'lib/tty2/reader/completion_event.rb', line 10

def completions
  @completions
end

#lineObject (readonly)

The line with word to complete



13
14
15
# File 'lib/tty2/reader/completion_event.rb', line 13

def line
  @line
end

#wordObject (readonly)

The initial word to complete



16
17
18
# File 'lib/tty2/reader/completion_event.rb', line 16

def word
  @word
end