Class: SyntaxSuggest::MiniStringIO
- Inherits:
-
Object
- Object
- SyntaxSuggest::MiniStringIO
- Defined in:
- lib/syntax_suggest/core_ext.rb
Overview
Mini String IO [Private]
Acts like a StringIO with reduced API, but without having to require that class.
Instance Attribute Summary collapse
-
#isatty ⇒ Object
readonly
Returns the value of attribute isatty.
-
#string ⇒ Object
readonly
Returns the value of attribute string.
Instance Method Summary collapse
-
#initialize(isatty: $stderr.isatty) ⇒ MiniStringIO
constructor
A new instance of MiniStringIO.
- #puts(value = $/) ⇒ Object
Constructor Details
#initialize(isatty: $stderr.isatty) ⇒ MiniStringIO
Returns a new instance of MiniStringIO.
11 12 13 14 |
# File 'lib/syntax_suggest/core_ext.rb', line 11 def initialize(isatty: $stderr.isatty) @string = +"" @isatty = isatty end |
Instance Attribute Details
#isatty ⇒ Object (readonly)
Returns the value of attribute isatty.
16 17 18 |
# File 'lib/syntax_suggest/core_ext.rb', line 16 def isatty @isatty end |
#string ⇒ Object (readonly)
Returns the value of attribute string.
21 22 23 |
# File 'lib/syntax_suggest/core_ext.rb', line 21 def string @string end |
Instance Method Details
#puts(value = $/) ⇒ Object
17 18 19 |
# File 'lib/syntax_suggest/core_ext.rb', line 17 def puts(value = $/, **) @string << value end |