Module: Selenium::WebDriver::DriverExtensions::HasLocation Private

Included in:
Chrome::Driver
Defined in:
lib/selenium/webdriver/common/driver_extensions/has_location.rb

This module is part of a private API. You should avoid using this module if possible, as it may be removed or be changed in the future.

Instance Method Summary collapse

Instance Method Details

#locationObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.


24
25
26
# File 'lib/selenium/webdriver/common/driver_extensions/has_location.rb', line 24

def location
  @bridge.location
end

#location=(loc) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Raises:

  • (TypeError)

28
29
30
31
32
# File 'lib/selenium/webdriver/common/driver_extensions/has_location.rb', line 28

def location=(loc)
  raise TypeError, "expected #{Location}, got #{loc.inspect}:#{loc.class}" unless loc.is_a?(Location)

  @bridge.set_location loc.latitude, loc.longitude, loc.altitude
end

#set_location(lat, lon, alt) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.


34
35
36
# File 'lib/selenium/webdriver/common/driver_extensions/has_location.rb', line 34

def set_location(lat, lon, alt)
  self.location = Location.new(Float(lat), Float(lon), Float(alt))
end