Class: Clin::LineReader::Basic

Inherits:
Object
  • Object
show all
Defined in:
lib/clin/line_reader/basic.rb

Overview

Basic line scanner. Use stdin#gets

Direct Known Subclasses

Readline

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(shell, statement, options = {}) ⇒ Basic

Returns a new instance of Basic.



15
16
17
18
19
# File 'lib/clin/line_reader/basic.rb', line 15

def initialize(shell, statement, options = {})
  @shell = shell
  @statement = statement
  @options = options
end

Instance Attribute Details

#optionsObject (readonly)

Returns the value of attribute options.



9
10
11
# File 'lib/clin/line_reader/basic.rb', line 9

def options
  @options
end

#statementObject (readonly)

Returns the value of attribute statement.



8
9
10
# File 'lib/clin/line_reader/basic.rb', line 8

def statement
  @statement
end

Class Method Details

.available?Boolean

Returns:

  • (Boolean)


11
12
13
# File 'lib/clin/line_reader/basic.rb', line 11

def self.available?
  true
end

Instance Method Details

#readlineObject



21
22
23
24
# File 'lib/clin/line_reader/basic.rb', line 21

def readline
  @shell.out.print(@statement)
  scan
end