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 inherited from MacroObject
Constructor Details
#initialize(h = {}) ⇒ FileOperationV21Action
Returns a new instance of FileOperationV21Action.
1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 |
# File 'lib/ruby-macrodroid/actions.rb', line 1257 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
1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 |
# File 'lib/ruby-macrodroid/actions.rb', line 1270 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 |