class TermuxRubyApi::SubSystems::Location
Public Instance Methods
get(provider: nil, request: nil)
click to toggle source
Returns the current location @param provider [:gps, :network, :passive]
:gps #=> Use GPS :network #=> Use mobile or Wifi network :passive #=> Use a low battery method
@param request [:once, :last, :updates]
:once #=> Return after the location is obtained :last #=> Return the last obtained location :updates #=> Send repeated updates as location is updated. Doesn't work in current version.
@return [Hash]
# File lib/termux_ruby_api/sub_systems/location.rb, line 14 def get(provider: nil, request: nil) args = owner.generate_args_list([['-p', provider], ['-r', request] ]) res = owner.json_api_command('location', nil, *args) TermuxRubyApi::Utils::Xformer.xform(res, provider: :symbol) end
gps(request: nil)
click to toggle source