Class: Txter::Gateway4info
Defined Under Namespace
Classes: Request, Response
Constant Summary
collapse
- API =
'http://gateway.4info.net/msg'
Constants inherited
from Gateway
Txter::Gateway::Error, Txter::Gateway::Success
Class Method Summary
collapse
Methods inherited from Gateway
current, unblock
Class Method Details
.deliver(message, number) ⇒ Object
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
|
# File 'lib/gateway_4info.rb', line 10
def self.perform(body)
if :live == Txter.mode
require 'net/http'
uri = URI.parse API
body = start do |http|
http.post(
uri.path,
body,
{'Content-Type' => 'text/xml'}
).read_body
end
Response.new(body)
else
Txter.log "Would have sent to 4info.net: #{body}"
end
end
|