Skip to content

Latest commit

 

History

History
27 lines (20 loc) · 700 Bytes

ucengine-rb.md

File metadata and controls

27 lines (20 loc) · 700 Bytes

Ruby library

Installation

gem install ucengine

Getting started

require 'rubygems'
require 'ucengine'

uce = UCEngine.new("localhost", 4567)
uce.connect("uce@example.org", :credential => 'pwd') do |uce|
  uce.subscribe("", :type => 'chat.message.new', :search => 'HTML5') do |event|
    uce.publish(:location => event['location'],
                :from => 'bot',
                :type => 'chat.message.new',
                :metadata => {"text" => "Hey, you were talking about HTML5",
                              "lang" => event['metadata']['lang']})
  end
end

More?

See the full API documentation on rubydoc.info