Class: TermuxRubyApi::SubSystems::Sms
- Defined in:
- lib/termux_ruby_api/sub_systems/sms.rb
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
- #draft(limit: nil, offset: nil) ⇒ Array <Hash>
-
#draft_all ⇒ Array <Hash>
Lists all the SMS messages in the draft folder of the phone, with no pagination.
-
#inbox(limit: nil, offset: nil) ⇒ Array <Hash>
Lists the SMS messages in the inbox folder of the phone.
-
#inbox_all ⇒ Array <Hash>
Lists all the SMS messages in the inbox folder of the phone, with no pagination.
-
#list(limit: nil, offset: nil, type: nil) ⇒ Array <Hash>
Gets part of the list of SMS messages in the phone.
-
#list_all(type: nil) ⇒ Array <Hash>
Lists all the SMS messages in the phone, with no pagination.
-
#outbox(limit: nil, offset: nil) ⇒ Array <Hash>
Lists the SMS messages in the outbox folder of the phone.
-
#outbox_all ⇒ Array <Hash>
Lists all the SMS messages in the outbox folder of the phone, with no pagination.
-
#send(msg, *numbers) ⇒ Object
Sends an SMS message.
-
#sent(limit: nil, offset: nil) ⇒ Array <Hash>
Lists the SMS messages in the sent folder of the phone.
-
#sent_all ⇒ Array <Hash>
Lists all the SMS messages in the sent folder of the phone, with no pagination.
Methods inherited from Base
Constructor Details
This class inherits a constructor from TermuxRubyApi::SubSystems::Base
Instance Method Details
#draft(limit: nil, offset: nil) ⇒ Array <Hash>
72 73 74 |
# 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 |
#draft_all ⇒ Array <Hash>
Lists all the SMS messages in the draft folder of the phone, with no pagination
78 79 80 |
# File 'lib/termux_ruby_api/sub_systems/sms.rb', line 78 def draft_all list_all(type: :draft) end |
#inbox(limit: nil, offset: nil) ⇒ Array <Hash>
Lists the SMS messages in the inbox folder of the phone
30 31 32 |
# 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 |
#inbox_all ⇒ Array <Hash>
Lists all the SMS messages in the inbox folder of the phone, with no pagination
36 37 38 |
# File 'lib/termux_ruby_api/sub_systems/sms.rb', line 36 def inbox_all list_all(type: :inbox) end |
#list(limit: nil, offset: nil, type: nil) ⇒ Array <Hash>
Gets part of the list of SMS messages in the phone
9 10 11 12 13 14 15 16 17 |
# 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 |
#list_all(type: nil) ⇒ Array <Hash>
Lists all the SMS messages in the phone, with no pagination
22 23 24 |
# File 'lib/termux_ruby_api/sub_systems/sms.rb', line 22 def list_all(type: nil) list(limit: -1, type: type) end |
#outbox(limit: nil, offset: nil) ⇒ Array <Hash>
Lists the SMS messages in the outbox folder of the phone
44 45 46 |
# 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 |
#outbox_all ⇒ Array <Hash>
Lists all the SMS messages in the outbox folder of the phone, with no pagination
50 51 52 |
# File 'lib/termux_ruby_api/sub_systems/sms.rb', line 50 def outbox_all list_all(type: :outbox) end |
#send(msg, *numbers) ⇒ Object
Sends an SMS message
85 86 87 88 |
# 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 |
#sent(limit: nil, offset: nil) ⇒ Array <Hash>
Lists the SMS messages in the sent folder of the phone
58 59 60 |
# 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 |
#sent_all ⇒ Array <Hash>
Lists all the SMS messages in the sent folder of the phone, with no pagination
64 65 66 |
# File 'lib/termux_ruby_api/sub_systems/sms.rb', line 64 def sent_all list_all(type: :sent) end |