Sha256: d1773482446529001981e81a40603365cebb5a6dd4ec46dfee3ee589b1090643

Contents?: true

Size: 566 Bytes

Versions: 1

Compression:

Stored size: 566 Bytes

Contents

require 'digest/md5'
require 'httparty'

require "smsc/sender"
require "smsc/version"

module Smsc
  class Sms
    attr_reader :login, :password, :charset

    def initialize(login, password, charset = 'utf-8')
      @login = login
      @password = Digest::MD5.hexdigest(password.to_s)
      @charset = charset
    end

    def message(message, phones)
      phones = phones.join(",")
      Smsc::Sender.post('https://smsc.ru/sys/send.php', :query => { :login => login, :psw => password, :phones => phones, :mes => message, :charset => charset })
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
smsc-0.0.3 lib/smsc.rb