Class: Core::Io::Buffer
- Inherits:
-
Object
- Object
- Core::Io::Buffer
- Defined in:
- app/api/core/io/buffer.rb
Instance Method Summary collapse
- #flush ⇒ Object
-
#initialize(stream) {|_self| ... } ⇒ Buffer
constructor
A new instance of Buffer.
- #write(value) ⇒ Object
Constructor Details
#initialize(stream) {|_self| ... } ⇒ Buffer
Returns a new instance of Buffer.
3 4 5 6 7 8 9 |
# File 'app/api/core/io/buffer.rb', line 3 def initialize(stream) @stream, @buffer = stream, StringIO.new return unless block_given? yield(self) force_flush end |
Instance Method Details
#flush ⇒ Object
16 17 18 |
# File 'app/api/core/io/buffer.rb', line 16 def flush # Ignore flush for the moment end |
#write(value) ⇒ Object
11 12 13 14 |
# File 'app/api/core/io/buffer.rb', line 11 def write(value) @buffer.write(value) force_flush if @buffer.string.length > configatron.api.flush_response_at end |