module Semse

Constants

API_ADDR
STATUSES
VERSION

Public Class Methods

configure() { |self| ... } click to toggle source
# File lib/semse.rb, line 26
def self.configure
  yield self
end
send(recipient, message, polish_chars=0) click to toggle source
# File lib/semse.rb, line 30
def self.send(recipient, message, polish_chars=0)
  args = {
    'apiKey' => api_key,
    'apiSecret' => api_secret,
    'queryType' => 1,
    'msgTo' => recipient,
    'msgBody' => message,
    'polishChars' => polish_chars
  }
  resp = Net::HTTP.post_form(URI(API_ADDR), args)
  
  if resp.code == "200"
    JSON.parse(resp.body)
  else
    nil    
  end
end