Class: Sqrewdriver::Client::SendingBuffer::Chunk
- Inherits:
-
Object
- Object
- Sqrewdriver::Client::SendingBuffer::Chunk
- Defined in:
- lib/sqrewdriver/client.rb
Instance Attribute Summary collapse
-
#bytesize ⇒ Object
readonly
Returns the value of attribute bytesize.
-
#data ⇒ Object
readonly
Returns the value of attribute data.
Instance Method Summary collapse
- #add(message, size) ⇒ Object
-
#initialize ⇒ Chunk
constructor
A new instance of Chunk.
- #size ⇒ Object
Constructor Details
#initialize ⇒ Chunk
Returns a new instance of Chunk.
49 50 51 52 |
# File 'lib/sqrewdriver/client.rb', line 49 def initialize @data = [] @bytesize = 0 end |
Instance Attribute Details
#bytesize ⇒ Object (readonly)
Returns the value of attribute bytesize.
47 48 49 |
# File 'lib/sqrewdriver/client.rb', line 47 def bytesize @bytesize end |
#data ⇒ Object (readonly)
Returns the value of attribute data.
47 48 49 |
# File 'lib/sqrewdriver/client.rb', line 47 def data @data end |
Instance Method Details
#add(message, size) ⇒ Object
54 55 56 57 |
# File 'lib/sqrewdriver/client.rb', line 54 def add(, size) @data << @bytesize += size end |
#size ⇒ Object
59 60 61 |
# File 'lib/sqrewdriver/client.rb', line 59 def size @data.size end |