class TextEditor::Command

Public Class Methods

call(editor, *args, &block) click to toggle source
   # File lib/text_editor/command.rb
10 def self.call(editor, *args, &block)
11   new(editor).run(*args, &block)
12 end

Public Instance Methods

content() click to toggle source
   # File lib/text_editor/command.rb
14 def content
15   buffer.line(line)
16 end
run(*) click to toggle source
   # File lib/text_editor/command.rb
18 def run(*)
19   raise NotImplementedError
20 end
scan() click to toggle source
   # File lib/text_editor/command.rb
22 def scan
23   @scan ||= StringScanner.new(content)
24 end