Class: Abalone::Buffer

Inherits:
Object
  • Object
show all
Defined in:
lib/abalone/buffer.rb

Instance Method Summary collapse

Constructor Details

#initializeBuffer

Returns a new instance of Buffer.



3
4
5
# File 'lib/abalone/buffer.rb', line 3

def initialize
  @buffer = ''
end

Instance Method Details

#close_connectionObject



13
14
15
# File 'lib/abalone/buffer.rb', line 13

def close_connection
  # nop
end

#replayObject



17
18
19
20
21
# File 'lib/abalone/buffer.rb', line 17

def replay
  retval  = @buffer
  @buffer = ''
  retval
end

#send(message) ⇒ Object



7
8
9
10
11
# File 'lib/abalone/buffer.rb', line 7

def send(message)
  @buffer << JSON.parse(message)['data']
rescue
  nil
end