Class: Amalgalite::Taps::StringIO

Inherits:
IO
  • Object
show all
Defined in:
lib/amalgalite/taps/io.rb

Overview

This class provides an IO tap that writes to a StringIO. The result is available via .to_s or .string.

Instance Attribute Summary

Attributes inherited from IO

#io, #profile_tap, #trace_count

Instance Method Summary collapse

Methods inherited from IO

#dump_profile, #output_profile_event, #profile, #samplers, #trace

Constructor Details

#initializeStringIO

Returns a new instance of StringIO.



62
63
64
65
# File 'lib/amalgalite/taps/io.rb', line 62

def initialize
  @stringio = ::StringIO.new
  super( @stringio )
end

Instance Method Details

#to_sObject Also known as: string



67
68
69
# File 'lib/amalgalite/taps/io.rb', line 67

def to_s
  @stringio.string
end