Spec-Zone.ru › Ruby 2.7

класс Bundler::Thor::LineEditor::Basic

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

Атрибуты

options[R]
prompt[R]

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

available?() Показать исходный код
# File lib/bundler/vendor/thor/lib/thor/line_editor/basic.rb, line 6
def self.available?
  true
end
new(prompt, options) Показать исходный код
# File lib/bundler/vendor/thor/lib/thor/line_editor/basic.rb, line 10
def initialize(prompt, options)
  @prompt = prompt
  @options = options
end

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

readline() Показать исходный код
# File lib/bundler/vendor/thor/lib/thor/line_editor/basic.rb, line 15
def readline
  $stdout.print(prompt)
  get_input
end

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

echo?() Показать исходный код
# File lib/bundler/vendor/thor/lib/thor/line_editor/basic.rb, line 32
def echo?
  options.fetch(:echo, true)
end
get_input() Показать исходный код
# File lib/bundler/vendor/thor/lib/thor/line_editor/basic.rb, line 22
def get_input
  if echo?
    $stdin.gets
  else
    # Lazy-load io/console since it is gem-ified as of 2.3
    require "io/console"
    $stdin.noecho(&:gets)
  end
end

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

Spec-Zone.ru

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