class TermuxRubyApi::SubSystems::Sms
Public Instance Methods
Lists the SMS messages in the draft folder of the phone @param limit [Fixnum] Number of messages to return @param offset [Fixnum] Start from message @return (see list
)
# File lib/termux_ruby_api/sub_systems/sms.rb, line 72 def draft(limit: nil, offset: nil) list(limit: limit, offset: offset, type: :draft) end
Lists all the SMS messages in the draft folder of the phone, with no pagination @return (see list
)
# File lib/termux_ruby_api/sub_systems/sms.rb, line 78 def draft_all list_all(type: :draft) end
Lists the SMS messages in the inbox folder of the phone @param limit [Fixnum] Number of messages to return @param offset [Fixnum] Start from message @return (see list
)
# File lib/termux_ruby_api/sub_systems/sms.rb, line 30 def inbox(limit: nil, offset: nil) list(limit: limit, offset: offset, type: :inbox) end
Lists all the SMS messages in the inbox folder of the phone, with no pagination @return (see list
)
# File lib/termux_ruby_api/sub_systems/sms.rb, line 36 def inbox_all list_all(type: :inbox) end
Gets part of the list of SMS messages in the phone @param limit [Fixnum] Number of messages to return @param offset [Fixnum] Start from message @param type [:inbox, :outbox, :sent] @return [Array <Hash>]
# File lib/termux_ruby_api/sub_systems/sms.rb, line 9 def list(limit: nil, offset: nil, type: nil) args = [] args = owner.generate_args_list([['-l', limit&.to_s], ['-o', offset&.to_s], ['-t', type] ]) res = owner.json_api_command('sms-list', nil, *args) TermuxRubyApi::Utils::Xformer.xform(res, received: :time, type: :symbol) end
Lists all the SMS messages in the phone, with no pagination @param type [:inbox, :outbox, :sent] @return (see list
)
# File lib/termux_ruby_api/sub_systems/sms.rb, line 22 def list_all(type: nil) list(limit: -1, type: type) end
Lists the SMS messages in the outbox folder of the phone @param limit [Fixnum] Number of messages to return @param offset [Fixnum] Start from message @return (see list
)
# File lib/termux_ruby_api/sub_systems/sms.rb, line 44 def outbox(limit: nil, offset: nil) list(limit: limit, offset: offset, type: :outbox) end
Lists all the SMS messages in the outbox folder of the phone, with no pagination @return (see list
)
# File lib/termux_ruby_api/sub_systems/sms.rb, line 50 def outbox_all list_all(type: :outbox) end
Sends an SMS message @param msg [String] the text of the message @param numbers [String] all subsequent params are interpreted as numbers to send the message to
# File lib/termux_ruby_api/sub_systems/sms.rb, line 85 def send(msg, *numbers) args = owner.generate_args(["-n", "#{numbers.join(',')}"]) owner.api_command('sms-send', msg, *args) end
Lists the SMS messages in the sent folder of the phone @param limit [Fixnum] Number of messages to return @param offset [Fixnum] Start from message @return (see list
)
# File lib/termux_ruby_api/sub_systems/sms.rb, line 58 def sent(limit: nil, offset: nil) list(limit: limit, offset: offset, type: :sent) end
Lists all the SMS messages in the sent folder of the phone, with no pagination @return (see list
)
# File lib/termux_ruby_api/sub_systems/sms.rb, line 64 def sent_all list_all(type: :sent) end