examples/poolparty/bees/presence.rb
# When a bee gets handed a payload, this method, on_data
# is called for the bee
When a bee gets handed a payload, this method, on_data
is called for the bee
When a bee gets handed a payload this method on_data is called for the bee
def on_data(package)
    Troph::Log.info package.inspect
    case package.action
    when "a"
      Troph::Log.info "Received add presence: #{package.payload}"
    else
      Troph::Log.info "received presence message: #{package.payload}"
    end
  end
def on_data ( package ) Troph :: Log . info package . inspect case package . action when "a" Troph :: Log . info "Received add presence: #{package.payload}" else Troph :: Log . info "received presence message: #{package.payload}" end end
When a bee gets handed a payload, this method, on_data
is called for the bee
When a bee gets handed a payload this method on_data is called for the bee
# Do stuff with the payload
package
<not_specific>