Class: Appium::Core::Device::ScreenRecord

Inherits:
Object
  • Object
show all
Defined in:
lib/appium_lib_core/device/screen_record.rb

Constant Summary collapse

METHOD =
%w(POST PUT).freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(remote_path: nil, user: nil, pass: nil, method: 'PUT', force_restart: nil) ⇒ ScreenRecord

Returns a new instance of ScreenRecord.



13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# File 'lib/appium_lib_core/device/screen_record.rb', line 13

def initialize(remote_path: nil, user: nil, pass: nil, method: 'PUT', force_restart: nil)
  @upload_option = if remote_path.nil?
                     {}
                   else
                     raise 'method should be POST or PUT' unless METHOD.member?(method.to_s.upcase)

                     option = {}
                     option[:remotePath] = remote_path
                     option[:user] = user unless user.nil?
                     option[:pass] = pass unless pass.nil?
                     option[:method] = method
                     option
                   end

  return if force_restart.nil?

  raise 'force_restart should be true or false' unless [true, false].member?(force_restart)
  @upload_option[:forceRestart] = force_restart
end

Instance Attribute Details

#upload_optionObject (readonly)

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.



9
10
11
# File 'lib/appium_lib_core/device/screen_record.rb', line 9

def upload_option
  @upload_option
end