Sha256: a33cc025a71c20e88182d15e533d898dc5cf53cc74de343eccca8a5053831560

Contents?: true

Size: 852 Bytes

Versions: 3

Compression:

Stored size: 852 Bytes

Contents

module Rink
  module LineProcessor
    # 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.
    #
    class Base
      attr_reader :source
      
      def initialize(source = nil)
        @source = source
      end
      
      # 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.
      def autocomplete(line, namespace)
        raise NotImplementedError, "autocomplete"
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
rink-1.0.2 lib/rink/line_processor/base.rb
rink-1.0.1 lib/rink/line_processor/base.rb
rink-1.0.0 lib/rink/line_processor/base.rb