Class: Discussion

Inherits:
EM::Channel
  • Object
show all
Defined in:
lib/cockatoo_http_server.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeDiscussion

Returns a new instance of Discussion.



42
43
44
45
# File 'lib/cockatoo_http_server.rb', line 42

def initialize
  @log = []
  super()
end

Instance Attribute Details

#logObject

Returns the value of attribute log.



40
41
42
# File 'lib/cockatoo_http_server.rb', line 40

def log
  @log
end

Instance Method Details

#say(ary) ⇒ Object



47
48
49
50
51
52
# File 'lib/cockatoo_http_server.rb', line 47

def say(ary)
  ary = [ ary ].flatten
  @log = (@log + ary)[0, 500]
  json = Yajl::Encoder.encode(ary)
  push json
end