Class: Rink::LineProcessor::Base
- 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
Instance Attribute Summary collapse
-
#source ⇒ Object
readonly
Returns the value of attribute source.
Instance Method Summary collapse
-
#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.
-
#initialize(source = nil) ⇒ Base
constructor
A new instance of Base.
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
#source ⇒ Object (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.
18 19 20 |
# File 'lib/rink/line_processor/base.rb', line 18 def autocomplete(line, namespace) raise NotImplementedError, "autocomplete" end |