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.
1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 |
# File 'lib/ruby-macrodroid/actions.rb', line 1054 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
1071 1072 1073 |
# File 'lib/ruby-macrodroid/actions.rb', line 1071 def to_s(colour: false, indent: 0) 'Fill Clipboard' + "\n " + @h[:clipboard_text] #+ @h.inspect end |