Class: Gem::StringSink
Relationships & Source Files | |
Inherits: | Object |
Defined in: | lib/rubygems/util/stringio.rb |
Class Method Summary
- .new ⇒ StringSink constructor
Instance Attribute Summary
- #string readonly
Instance Method Summary
Constructor Details
.new ⇒ StringSink
# File 'lib/rubygems/util/stringio.rb', line 2
def initialize @string = "" end
Instance Attribute Details
#string (readonly)
[ GitHub ]# File 'lib/rubygems/util/stringio.rb', line 6
attr_reader :string
Instance Method Details
#set_encoding(enc)
[ GitHub ]# File 'lib/rubygems/util/stringio.rb', line 13
def set_encoding(enc) @string.force_encoding enc end
#write(s)
[ GitHub ]# File 'lib/rubygems/util/stringio.rb', line 8
def write(s) @string += s s.size end