Class: FastRI::StringRedirectedDisplay

Inherits:
DefaultDisplay show all
Defined in:
lib/fastri/ri_service.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from DefaultDisplay

#full_params

Constructor Details

#initialize(*args) ⇒ StringRedirectedDisplay

Returns a new instance of StringRedirectedDisplay.



31
32
33
34
# File 'lib/fastri/ri_service.rb', line 31

def initialize(*args)
  super(*args)
  reset_stringio
end

Instance Attribute Details

#formatterObject (readonly)

Returns the value of attribute formatter.



30
31
32
# File 'lib/fastri/ri_service.rb', line 30

def formatter
  @formatter
end

#stringioObject (readonly)

Returns the value of attribute stringio.



30
31
32
# File 'lib/fastri/ri_service.rb', line 30

def stringio
  @stringio
end

Instance Method Details



40
41
42
# File 'lib/fastri/ri_service.rb', line 40

def print(*a)
  @stringio.print(*a)
end

#puts(*a) ⇒ Object



36
37
38
# File 'lib/fastri/ri_service.rb', line 36

def puts(*a)
  @stringio.puts(*a)
end

#reset_stringioObject



44
45
46
47
# File 'lib/fastri/ri_service.rb', line 44

def reset_stringio
  @stringio = StringIO.new("")
  @formatter.stringio = @stringio
end