Module | Tinder |
In: |
lib/tinder/version.rb
lib/tinder/room.rb lib/tinder/campfire.rb lib/tinder/connection.rb lib/tinder.rb |
encoding: UTF-8
VERSION | = | '1.10.1' unless defined?(::Tinder::VERSION) |
Listen for new messages in the room, parsing them with parse_message and then yielding them to the provided block as they arrive.
room.listen do |m| room.speak "Go away!" if m[:body] =~ /Java/i end
Modifies a hash representation of a Campfire message. Expands +:user_id+ to a full hash at +:user+, generates Timestamp from +:created_at+.
Full returned hash:
Get a list of recent messages Accepts a hash for options:
Search transcripts for the given term (returns an array of messages parsed via parse_message, see parse_message for format of returned message)
Get the transcript for the given date (Returns a hash in the same format as listen)
room.transcript(Time.now) #=> [{:message=>"foobar!", :user_id=>"99999", :person=>"Brandon", :id=>"18659245", :timestamp=>=>Tue May 05 07:15:00 -0700 2009}]
The timestamp slot will typically have a granularity of five minutes.