Class: Discussion
- Defined in:
- lib/cockatoo_http_server.rb
Instance Attribute Summary collapse
-
#log ⇒ Object
Returns the value of attribute log.
Instance Method Summary collapse
-
#initialize ⇒ Discussion
constructor
A new instance of Discussion.
- #say(ary) ⇒ Object
Constructor Details
#initialize ⇒ Discussion
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
#log ⇒ Object
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 |