123456789_123456789_123456789_123456789_123456789_

Class: SyntaxSuggest::MiniStringIO

Relationships & Source Files
Inherits: Object
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.

Class Method Summary

Instance Attribute Summary

Instance Method Summary

Constructor Details

.new(isatty: $stderr.isatty) ⇒ MiniStringIO

[ GitHub ]

  
# File 'lib/syntax_suggest/core_ext.rb', line 11

def initialize(isatty: $stderr.isatty)
  @string = +""
  @isatty = isatty
end

Instance Attribute Details

#isatty (readonly)

[ GitHub ]

  
# File 'lib/syntax_suggest/core_ext.rb', line 16

attr_reader :isatty

#string (readonly)

[ GitHub ]

  
# File 'lib/syntax_suggest/core_ext.rb', line 21

attr_reader :string

Instance Method Details

#puts(value = $/)

[ GitHub ]

  
# File 'lib/syntax_suggest/core_ext.rb', line 17

def puts(value = $/, **)
  @string << value
end