Class: Reline::LineEditor::DialogProcScope

Inherits:
Object
  • Object
show all
Defined in:
lib/reline/line_editor.rb

Instance Method Summary collapse

Constructor Details

#initialize(line_editor, config, proc_to_exec, context) ⇒ DialogProcScope

Returns a new instance of DialogProcScope.



521
522
523
524
525
526
527
# File 'lib/reline/line_editor.rb', line 521

def initialize(line_editor, config, proc_to_exec, context)
  @line_editor = line_editor
  @config = config
  @proc_to_exec = proc_to_exec
  @context = context
  @cursor_pos = Reline::CursorPos.new
end

Instance Method Details

#callObject



582
583
584
# File 'lib/reline/line_editor.rb', line 582

def call
  instance_exec(&@proc_to_exec)
end

#call_completion_proc_with_checking_args(pre, target, post) ⇒ Object



537
538
539
# File 'lib/reline/line_editor.rb', line 537

def call_completion_proc_with_checking_args(pre, target, post)
  @line_editor.call_completion_proc_with_checking_args(pre, target, post)
end

#completion_journey_dataObject



574
575
576
# File 'lib/reline/line_editor.rb', line 574

def completion_journey_data
  @line_editor.instance_variable_get(:@completion_journey_data)
end

#configObject



578
579
580
# File 'lib/reline/line_editor.rb', line 578

def config
  @config
end

#contextObject



529
530
531
# File 'lib/reline/line_editor.rb', line 529

def context
  @context
end

#cursor_posObject



562
563
564
# File 'lib/reline/line_editor.rb', line 562

def cursor_pos
  @cursor_pos
end

#dialogObject



545
546
547
# File 'lib/reline/line_editor.rb', line 545

def dialog
  @dialog
end

#just_cursor_movingObject



566
567
568
# File 'lib/reline/line_editor.rb', line 566

def just_cursor_moving
  @line_editor.instance_variable_get(:@just_cursor_moving)
end

#keyObject



558
559
560
# File 'lib/reline/line_editor.rb', line 558

def key
  @key
end

#retrieve_completion_block(set_completion_quote_character = false) ⇒ Object



533
534
535
# File 'lib/reline/line_editor.rb', line 533

def retrieve_completion_block(set_completion_quote_character = false)
  @line_editor.retrieve_completion_block(set_completion_quote_character)
end

#screen_widthObject



570
571
572
# File 'lib/reline/line_editor.rb', line 570

def screen_width
  @line_editor.instance_variable_get(:@screen_size).last
end

#set_cursor_pos(col, row) ⇒ Object



549
550
551
552
# File 'lib/reline/line_editor.rb', line 549

def set_cursor_pos(col, row)
  @cursor_pos.x = col
  @cursor_pos.y = row
end

#set_dialog(dialog) ⇒ Object



541
542
543
# File 'lib/reline/line_editor.rb', line 541

def set_dialog(dialog)
  @dialog = dialog
end

#set_key(key) ⇒ Object



554
555
556
# File 'lib/reline/line_editor.rb', line 554

def set_key(key)
  @key = key
end