Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # coding: utf-8
- require 'sequel'
- class Chat
- @@DB=Sequel.sqlite
- @@DB.create_table :messages do
- primary_key :id
- String :body
- String :username
- end
- @@messages=@@DB[:messages]
- def Chat.send(params, user_info)
- @@messages.insert(:body=>params[:body], :username=>user_info[:username])
- end
- def Chat.get(params, user_info)
- @@messages.all
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement