Class: Rink::LineProcessor::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/rink/line_processor/base.rb

Overview

The Line Processor takes partial lines and performs operations on them. This is usually triggered by some special character or combination of characters, such as TAB, ARROW UP, ARROW DOWN, and so forth.

Direct Known Subclasses

PureRuby

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(source = nil) ⇒ Base

Returns a new instance of Base.



9
10
11
# File 'lib/rink/line_processor/base.rb', line 9

def initialize(source = nil)
  @source = source
end

Instance Attribute Details

#sourceObject (readonly)

Returns the value of attribute source.



7
8
9
# File 'lib/rink/line_processor/base.rb', line 7

def source
  @source
end

Instance Method Details

#autocomplete(line, namespace) ⇒ Object

Autocomplete is usually triggered by a TAB character and generally involves looking at the beginning of a line and finding the command the user is most likely trying to type. This saves typing for the user and creates a more intuitive interface.

This method returns either a single String or an array of Strings.

Raises:

  • (NotImplementedError)


18
19
20
# File 'lib/rink/line_processor/base.rb', line 18

def autocomplete(line, namespace)
  raise NotImplementedError, "autocomplete"
end