Spec-Zone.ru › Ruby 3.4

класс Reline::LineEditor::Dialog

Родитель:
Объект

Атрибуты

column [RW]
contents [R]
name [R]
pointer [RW]
scroll_top [RW]
trap_key [RW]
vertical_offset [RW]
width [R]

Публичные методы класса

new (name, config, proc_scope)
Исходный код
# File lib/reline/line_editor.rb, line 651
def initialize(name, config, proc_scope)
  @name = name
  @config = config
  @proc_scope = proc_scope
  @width = nil
  @scroll_top = 0
  @trap_key = nil
end

Публичные методы экземпляра

call (key)
Исходный код
# File lib/reline/line_editor.rb, line 675
def call(key)
  @proc_scope.set_dialog(self)
  @proc_scope.set_key(key)
  dialog_render_info = @proc_scope.call
  if @trap_key
    if @trap_key.any?{ |i| i.is_a?(Array) } # multiple trap
      @trap_key.each do |t|
        @config.add_oneshot_key_binding(t, @name)
      end
    else
      @config.add_oneshot_key_binding(@trap_key, @name)
    end
  end
  dialog_render_info
end
contents= (contents)
Исходный код
# File lib/reline/line_editor.rb, line 668
def contents=(contents)
  @contents = contents
  if contents and @width.nil?
    @width = contents.map{ |line| Reline::Unicode.calculate_width(line, true) }.max
  end
end
set_cursor_pos (col, row)
Исходный код
# File lib/reline/line_editor.rb, line 660
def set_cursor_pos(col, row)
  @proc_scope.set_cursor_pos(col, row)
end
width= (v)
Исходный код
# File lib/reline/line_editor.rb, line 664
def width=(v)
  @width = v
end

Ruby Core © 1993–2024 Yukihiro Matsumoto
Licensed under the Ruby License.
Ruby Standard Library © contributors
Licensed under their own licenses.

Spec-Zone.ru

Настройки Оффлайн Что нового Помощь О нас
Spec-Zone .ru
спецификации, руководства, описания, API