Class: FileOperationV21Action
- Inherits:
-
FileAction
- Object
- MacroObject
- Action
- FileAction
- FileOperationV21Action
- Defined in:
- lib/ruby-macrodroid/actions.rb
Overview
Category: Files
Instance Attribute Summary
Attributes inherited from Action
Attributes inherited from MacroObject
Instance Method Summary collapse
-
#initialize(h = {}) ⇒ FileOperationV21Action
constructor
A new instance of FileOperationV21Action.
- #to_s(colour: false, indent: 0) ⇒ Object (also: #to_summary)
Methods inherited from Action
Methods included from ObjectX
#action_to_object, #object_create, #varify
Methods inherited from MacroObject
Constructor Details
#initialize(h = {}) ⇒ FileOperationV21Action
Returns a new instance of FileOperationV21Action.
1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 |
# File 'lib/ruby-macrodroid/actions.rb', line 1410 def initialize(h={}) = { :app_name=>"", :class_name=>"", :package_name=>"", :file_path=>"", :file_extensions=>["jpg", "jpeg", "png", "raw", "bmp", "tif", "tiff", "gif"], :file_option=>2, :from_name=>"Sent", :from_uri_string=>"", :option=>2 } super(.merge h) end |
Instance Method Details
#to_s(colour: false, indent: 0) ⇒ Object Also known as: to_summary
1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 |
# File 'lib/ruby-macrodroid/actions.rb', line 1423 def to_s(colour: false, indent: 0) operation = ['Copy', 'Move', 'Delete', 'Create Folder'] file = ['All Files', 'All Media Files', 'Images', 'Audio', 'Videos', 'Specify File Pattern', 'Folder'] detail = @h[:from_name] detail += ' to: ' + @h[:to_name] if @h[:option] == 1 @s = "%s %s" % [operation[@h[:option]], file[@h[:file_option]]] \ + "\n" + detail #+ @h.inspect super() end |