Class: TermuxRubyApi::SubSystems::CallLog

Inherits:
Base
  • Object
show all
Defined in:
lib/termux_ruby_api/sub_systems/call_log.rb

Instance Attribute Summary

Attributes inherited from Base

#owner

Instance Method Summary collapse

Methods inherited from Base

#initialize

Constructor Details

This class inherits a constructor from TermuxRubyApi::SubSystems::Base

Instance Method Details

#log(limit: nil, offset: nil) ⇒ Array <Hash>

Gets part of the list of phone calls in the phone

Parameters:

  • limit (Fixnum) (defaults to: nil)

    Number of messages to return

  • offset (Fixnum) (defaults to: nil)

    Start from message

Returns:

  • (Array <Hash>)


8
9
10
11
12
13
14
# File 'lib/termux_ruby_api/sub_systems/call_log.rb', line 8

def log(limit:nil, offset:nil)
  args = owner.generate_args_list([['-l', limit&.to_s],
                                   ['-o', offset&.to_s]
                                  ])
  res = owner.json_api_command('call-log', nil, *args)
  TermuxRubyApi::Utils::Xformer.xform(res, date: :time, duration: :duration, type: :symbol)
end

#log_allArray <Hash>

Gets the whole list of phone calls in the phone, with no pagination

Returns:

  • (Array <Hash>)


18
19
20
# File 'lib/termux_ruby_api/sub_systems/call_log.rb', line 18

def log_all
  log(limit: -1)
end