Class: Clin::LineReader::Basic
- Inherits:
-
Object
- Object
- Clin::LineReader::Basic
- Defined in:
- lib/clin/line_reader/basic.rb
Overview
Basic line scanner. Use stdin#gets
Direct Known Subclasses
Instance Attribute Summary collapse
-
#options ⇒ Object
readonly
Returns the value of attribute options.
-
#statement ⇒ Object
readonly
Returns the value of attribute statement.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(shell, statement, options = {}) ⇒ Basic
constructor
A new instance of Basic.
- #readline ⇒ Object
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, = {}) @shell = shell @statement = statement @options = end |
Instance Attribute Details
#options ⇒ Object (readonly)
Returns the value of attribute options.
9 10 11 |
# File 'lib/clin/line_reader/basic.rb', line 9 def @options end |
#statement ⇒ Object (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
11 12 13 |
# File 'lib/clin/line_reader/basic.rb', line 11 def self.available? true end |
Instance Method Details
#readline ⇒ Object
21 22 23 24 |
# File 'lib/clin/line_reader/basic.rb', line 21 def readline @shell.out.print(@statement) scan end |