Class: Sqrewdriver::Client::SendingBuffer::Chunk

Inherits:
Object
  • Object
show all
Defined in:
lib/sqrewdriver/client.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeChunk

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

#bytesizeObject (readonly)

Returns the value of attribute bytesize.



47
48
49
# File 'lib/sqrewdriver/client.rb', line 47

def bytesize
  @bytesize
end

#dataObject (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(message, size)
  @data << message
  @bytesize += size
end

#sizeObject



59
60
61
# File 'lib/sqrewdriver/client.rb', line 59

def size
  @data.size
end