Class: Rereline::KeyActor

Inherits:
Object
  • Object
show all
Defined in:
lib/rereline/key_actor.rb

Constant Summary collapse

MAPPING =
{
  [127] => [:BS],
  [13]  => [:CR],
  [27, 91, 67]  => [:RIGHT],
  [27, 91, 68]  => [:LEFT]
}

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(editor) ⇒ KeyActor

Returns a new instance of KeyActor.



12
13
14
# File 'lib/rereline/key_actor.rb', line 12

def initialize(editor)
  @editor = editor
end

Instance Attribute Details

#editorObject (readonly)

Returns the value of attribute editor.



10
11
12
# File 'lib/rereline/key_actor.rb', line 10

def editor
  @editor
end

Instance Method Details

#call(input) ⇒ Object



16
17
18
19
20
21
22
23
# File 'lib/rereline/key_actor.rb', line 16

def call(input)
  case input
  when Symbol
    editor_ctrl(input) && nil
  else
    input
  end
end