Class: Smsapi::Client

Inherits:
Object
  • Object
show all
Defined in:
lib/smsapi/client.rb

Instance Method Summary collapse

Constructor Details

#initialize(token) ⇒ Client

Returns a new instance of Client.



3
4
5
# File 'lib/smsapi/client.rb', line 3

def initialize(token)
  @server = Smsapi::Server.new(token)
end

Instance Method Details

#credits(options = {}) ⇒ Object



7
8
9
# File 'lib/smsapi/client.rb', line 7

def credits(options = {})
  Smsapi::Credits.new(@server, options).check
end

#schedule_single(to, message, date, options = {}) ⇒ Object



15
16
17
# File 'lib/smsapi/client.rb', line 15

def schedule_single(to, message, date, options = {})
  Smsapi::SMS.new(to, message, @server, options).deliver_at(date)
end

#send_bulk(to, message, options = {}) ⇒ Object



19
20
21
# File 'lib/smsapi/client.rb', line 19

def send_bulk(to, message, options = {})
  Smsapi::BulkSMS.new(to, message, @server, options).deliver
end

#send_single(to, message, options = {}) ⇒ Object



11
12
13
# File 'lib/smsapi/client.rb', line 11

def send_single(to, message, options = {})
  Smsapi::SMS.new(to, message, @server, options).deliver
end