Class: JazzFingers::Input

Inherits:
Object
  • Object
show all
Defined in:
lib/jazz_fingers/input.rb

Class Method Summary collapse

Class Method Details

.configObject



7
8
9
10
11
# File 'lib/jazz_fingers/input.rb', line 7

def config
  {
    cool: cool_input
  }
end

.cool_inputObject



13
14
15
16
17
18
19
20
21
22
23
24
# File 'lib/jazz_fingers/input.rb', line 13

def cool_input
  Coolline.new do |c|
    c.transform_proc = proc do
      CodeRay.scan(c.line, :ruby).term
    end

    c.completion_proc = proc do
      word = c.completed_word
      Object.constants.map(&:to_s).select { |w| w.start_with?(word) }
    end
  end
end