Class: Sprout::OutputBuffer

Inherits:
String
  • Object
show all
Defined in:
sprout/lib/sprout/output_buffer.rb

Instance Method Summary (collapse)

Methods inherited from String

#camel_case, #dash_case, #snake_case

Constructor Details

- (OutputBuffer) initialize(*args)

A new instance of OutputBuffer



6
7
8
9
# File 'sprout/lib/sprout/output_buffer.rb', line 6

def initialize *args
  super
  @characters = ''
end

Instance Method Details

- (Object) flush



29
30
# File 'sprout/lib/sprout/output_buffer.rb', line 29

def flush
end


15
16
17
# File 'sprout/lib/sprout/output_buffer.rb', line 15

def print msg
  @characters << msg
end

- (Object) printf(msg)



19
20
21
# File 'sprout/lib/sprout/output_buffer.rb', line 19

def printf msg
  @characters << msg
end

- (Object) puts(msg)



11
12
13
# File 'sprout/lib/sprout/output_buffer.rb', line 11

def puts msg
  @characters << msg
end

- (Object) read



23
24
25
26
27
# File 'sprout/lib/sprout/output_buffer.rb', line 23

def read
  response = @characters
  @characters = ''
  response
end