Class: Send

Inherits:
Mongrel::HttpHandler
  • Object
show all
Defined in:
lib/irc_cat/http_server/send.rb

Instance Method Summary collapse

Constructor Details

#initialize(bot, config) ⇒ Send

Returns a new instance of Send.



3
# File 'lib/irc_cat/http_server/send.rb', line 3

def initialize(bot, config); @bot = bot; @config = config; end

Instance Method Details

#process(request, response) ⇒ Object



5
6
7
8
9
10
11
# File 'lib/irc_cat/http_server/send.rb', line 5

def process(request, response)
  response.start(200) do |head,out|
    head["Content-Type"] = "text/plain"
    message = CGI::unescape("#{request.params['PATH_INFO'].gsub('/','')}")
    @bot.say(@config['irc']['channel'],"#{message}")
  end
end