class Nico::Listener
Public Class Methods
new(id, token)
click to toggle source
# File lib/nico/room/listener.rb, line 10 def initialize(id, token) @url = "http://#{token}:x@streaming.campfirenow.com/room/#{id}/live.json" end
Public Instance Methods
each() { |message| ... }
click to toggle source
# File lib/nico/room/listener.rb, line 14 def each Yajl::HttpStream.get(URI.parse @url) do |json| yield Message.new(json) end end