Class: TermuxRubyApi::SubSystems::Location
- Defined in:
- lib/termux_ruby_api/sub_systems/location.rb
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
-
#get(provider: nil, request: nil) ⇒ Hash
Returns the current location.
-
#gps(request: nil) ⇒ Hash
Returns the current location, using GPS.
-
#network(request: nil) ⇒ Hash
Returns the current location, using Mobile/Wifi network.
Methods inherited from Base
Constructor Details
This class inherits a constructor from TermuxRubyApi::SubSystems::Base
Instance Method Details
#get(provider: nil, request: nil) ⇒ Hash
Returns the current location
14 15 16 17 18 19 20 |
# 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) ⇒ Hash
Returns the current location, using GPS
25 26 27 |
# File 'lib/termux_ruby_api/sub_systems/location.rb', line 25 def gps(request: nil) get(provider: :gps, request: request) end |
#network(request: nil) ⇒ Hash
Returns the current location, using Mobile/Wifi network
32 33 34 |
# File 'lib/termux_ruby_api/sub_systems/location.rb', line 32 def network(request: nil) get(provider: :network, request: request) end |