class Object

Public Instance Methods

channelListCallback(message) click to toggle source
# File examples/channelList.rb, line 12
def channelListCallback(message)
        puts "ChannelListCallback"
        channels=Array.new
        @l_iterator=0
        #puts message
        #~ message="{\"total\":70,\"range\":[1,30],\"channels\":[\"abcd1\",\"abcd2\",\"abcd3\",\"abcd30\"]}"
        channelDatajson=JSON.parse(message)
        while channelDatajson["channels"][@l_iterator] != nil do
                channels[@l_iterator]=channelDatajson["channels"][@l_iterator]
                @l_iterator=@l_iterator+1
        end
        puts channels
        #TODO
end
connectionCallback(arg0) click to toggle source
# File examples/channelList.rb, line 7
def connectionCallback(arg0)
        puts arg0
end
errorMsgCallback(message) click to toggle source
# File examples/channelList.rb, line 44
def errorMsgCallback(message)
        puts "errorMsgCallback"
        puts message
        #TODO
end
historyMessageCallback(message) click to toggle source
# File examples/history.rb, line 19
def historyMessageCallback(message)
        #No a presence must me json & enable 
        puts "HistoryMessageCallback"
        puts message
        #TODO
end
presenceMessageCallback(message) click to toggle source
# File examples/subcribe.rb, line 27
def presenceMessageCallback(message)
        #must me json & enable 
        puts "presenceMessageCallback"
        puts message
        #TODO
end
subscribeReturnMessageCallback(message) click to toggle source
# File examples/subcribe.rb, line 12
def subscribeReturnMessageCallback(message)
        #No a presence must me json & enable 
        puts "subscribeReturnMessageCallback@@@"
        puts message
        #TODO
end
userListCallback(message) click to toggle source
# File examples/channelList.rb, line 28
def userListCallback(message)
        puts "UserListCallback"
        #puts message
        userList=Array.new
        @l_iterator=0
        #~ message="{\"total\":70,\"range\":[1,30],\"users\":[\"abcd1\",\"abcd2\",\"abcd3\",\"abcd30\"]}"
        userlistDatajson=JSON.parse(message)
        while userlistDatajson["users"][@l_iterator] != nil do
                userList[@l_iterator]=userlistDatajson["users"][@l_iterator]
                @l_iterator=@l_iterator+1
        end
        puts userList
        #TODO
end