Class: Bulksms::Service
- Inherits:
-
Object
- Object
- Bulksms::Service
- Defined in:
- lib/bulksms/service.rb
Instance Attribute Summary collapse
-
#account ⇒ Object
Returns the value of attribute account.
Instance Method Summary collapse
-
#deliver(*args) ⇒ Object
Send a single message or multiple messages.
-
#initialize(opts = {}) ⇒ Service
constructor
A new instance of Service.
Constructor Details
Instance Attribute Details
#account ⇒ Object
Returns the value of attribute account.
5 6 7 |
# File 'lib/bulksms/service.rb', line 5 def account @account end |
Instance Method Details
#deliver(*args) ⇒ Object
Send a single message or multiple messages.
12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/bulksms/service.rb', line 12 def deliver(*args) msg = args.shift opts = args.shift || {} case msg when Hash msg = Message.new(msg) when Array msg = msg.map{|m| m.is_a?(Message) ? m : Message.new(m)} end send_request(msg) end |