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

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

Defined Under Namespace

Modules: Command

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', file_field_name: nil, form_fields: nil, headers: nil, force_restart: nil) ⇒ ScreenRecord



28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
# File 'lib/appium_lib_core/common/device/screen_record.rb', line 28

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

                     option = {}
                     option[:remotePath] = remote_path
                     option[:user] = user unless user.nil?
                     option[:pass] = pass unless pass.nil?
                     option[:method] = method
                     option[:fileFieldName] = file_field_name unless file_field_name.nil?
                     option[:formFields] = form_fields unless form_fields.nil?
                     option[:headers] = headers unless headers.nil?
                     option
                   end

  return if force_restart.nil?

  unless [true, false].member?(force_restart)
    raise ::Appium::Core::Error::ArgumentError,
          'force_restart should be true or false'
  end

  @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.



24
25
26
# File 'lib/appium_lib_core/common/device/screen_record.rb', line 24

def upload_option
  @upload_option
end