Allow for an id or an enumerable for Biju::Hayes#delete
parent
77105b180a
commit
3656fd6d82
|
@ -105,7 +105,13 @@ module Biju
|
||||||
# Delete a sms message by id.
|
# Delete a sms message by id.
|
||||||
# @param [Fixnum] Id of sms message on modem.
|
# @param [Fixnum] Id of sms message on modem.
|
||||||
def delete(id)
|
def delete(id)
|
||||||
at_command('+CMGD', id)
|
id = [id] if id.kind_of?(Fixnum)
|
||||||
|
return unless id.kind_of?(Enumerable)
|
||||||
|
|
||||||
|
res = true
|
||||||
|
id.each { |i| res &= at_command('+CMGD', i)[:status] }
|
||||||
|
|
||||||
|
res
|
||||||
end
|
end
|
||||||
|
|
||||||
def send(sms, options = {})
|
def send(sms, options = {})
|
||||||
|
|
Loading…
Reference in New Issue