Module: Appium::Core::Device

Extended by:
Forwardable
Defined in:
lib/appium_lib_core/device.rb

Class Method Summary collapse

Class Method Details

.add_endpoint_method(method) ⇒ Object

Define method in Bridges


50
51
52
53
54
55
# File 'lib/appium_lib_core/device.rb', line 50

def add_endpoint_method(method)
  block_given? ? create_bridge_command(method, &Proc.new) : create_bridge_command(method)

  delegate_driver_method method
  delegate_from_appium_driver method
end

.extend_webdriver_with_forwardableObject


58
59
60
61
62
63
64
# File 'lib/appium_lib_core/device.rb', line 58

def extend_webdriver_with_forwardable
  return if ::Appium::Core::Base::Driver.is_a? Forwardable

  ::Appium::Core::Base::Driver.class_eval do
    extend Forwardable
  end
end

.extended(_mod) ⇒ Object


21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# File 'lib/appium_lib_core/device.rb', line 21

def extended(_mod)
  extend_webdriver_with_forwardable

  # Compatibility for appium_lib. Below command are extended by `extend Appium::Core::Deivce`in appium_lib.
  # TODO: Will remove
  [
    :take_element_screenshot, :save_viewport_screenshot,
    :lock, :device_locked?, :unlock,
    :hide_keyboard, :is_keyboard_shown,
    :ime_activate, :ime_available_engines, :ime_active_engine, :ime_activated, :ime_deactivate,
    :get_settings, :update_settings,
    :within_context, :switch_to_default_context, :current_context, :available_contexts, :set_context,
    :set_immediate_value, :replace_value,
    :push_file, :pull_file, :pull_folder,
    :keyevent, :press_keycode, :long_press_keycode,
    :match_images_features, :find_image_occurrence, :get_images_similarity, :compare_images,
    :launch_app, :close_app, :reset, :app_strings, :background_app,
    :install_app, :remove_app, :app_installed?, :activate_app, :terminate_app,
    :app_state,
    :stop_recording_screen, :stop_and_save_recording_screen,
    :shake, :device_time,
    :touch_actions, :multi_touch
  ].each(&method(:delegate_from_appium_driver))
end