Class: Smsapi::BulkSMS

Inherits:
Object
  • Object
show all
Includes:
Defaults
Defined in:
lib/smsapi/bulk_sms.rb

Direct Known Subclasses

GroupSMS

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Defaults

#default_options

Constructor Details

#initialize(to, message, server, options = {}) ⇒ BulkSMS

Returns a new instance of BulkSMS.



6
7
8
9
10
11
12
# File 'lib/smsapi/bulk_sms.rb', line 6

def initialize(to, message, server, options = {})
  @options = default_options.merge options
  @to = to
  @message = message
  @server = server
  @sent = []
end

Instance Attribute Details

#messageObject (readonly)

Returns the value of attribute message.



5
6
7
# File 'lib/smsapi/bulk_sms.rb', line 5

def message
  @message
end

#sentObject (readonly)

Returns the value of attribute sent.



5
6
7
# File 'lib/smsapi/bulk_sms.rb', line 5

def sent
  @sent
end

#toObject (readonly)

Returns the value of attribute to.



5
6
7
# File 'lib/smsapi/bulk_sms.rb', line 5

def to
  @to
end

Instance Method Details

#deliverObject



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

def deliver
  read_response @server.sms(server_params)
  self
end