Class: ClipboardAction
- Inherits:
-
DeviceAction
- Object
- MacroObject
- Action
- DeviceAction
- ClipboardAction
- Defined in:
- lib/ruby-macrodroid/actions.rb
Overview
Category: Device Actions
Instance Attribute Summary
Attributes inherited from Action
Attributes inherited from MacroObject
Instance Method Summary collapse
-
#initialize(obj = nil) ⇒ ClipboardAction
constructor
A new instance of ClipboardAction.
- #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(obj = nil) ⇒ ClipboardAction
Returns a new instance of ClipboardAction.
1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 |
# File 'lib/ruby-macrodroid/actions.rb', line 1079 def initialize(obj=nil) h = if obj.is_a? Hash then obj elsif obj.is_a? Array e, macro = obj {clipboard_text: e.text('item/description').to_s} end = { clipboard_text: '' } super(.merge h) end |
Instance Method Details
#to_s(colour: false, indent: 0) ⇒ Object Also known as: to_summary
1096 1097 1098 |
# File 'lib/ruby-macrodroid/actions.rb', line 1096 def to_s(colour: false, indent: 0) 'Fill Clipboard' + "\n " + @h[:clipboard_text] #+ @h.inspect end |