Class: TextManipulationAction
- Inherits:
-
MacroDroidAction
- Object
- MacroObject
- Action
- MacroDroidAction
- TextManipulationAction
- Defined in:
- lib/ruby-macrodroid/actions.rb
Overview
MacroDroid Specific
Instance Attribute Summary
Attributes inherited from Action
Attributes inherited from MacroObject
Instance Method Summary collapse
-
#initialize(h = {}) ⇒ TextManipulationAction
constructor
A new instance of TextManipulationAction.
- #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 = {}) ⇒ TextManipulationAction
Returns a new instance of TextManipulationAction.
2091 2092 2093 2094 2095 2096 2097 2098 |
# File 'lib/ruby-macrodroid/actions.rb', line 2091 def initialize(h={}) = { } super(h) end |
Instance Method Details
#to_s(colour: false, indent: 0) ⇒ Object Also known as: to_summary
2100 2101 2102 2103 2104 2105 2106 2107 2108 2109 2110 2111 2112 2113 2114 2115 2116 2117 2118 2119 2120 2121 2122 2123 |
# File 'lib/ruby-macrodroid/actions.rb', line 2100 def to_s(colour: false, indent: 0) #tm = @h[:text_manipulation][:type] #s = case tm[:type].to_sym s = case 3 # @h[:text_manipulation][:option].to_i when 0 # :SubstringManipulation "Substring(%s, %s)" % [@h[:text], tm[:params].join(', ')] when 1 # :ReplaceAllManipulation "Replace all(%s, %s, %s)" % [@h[:text], *tm[:params]] when 2 # :ExtractTextManipulation "Extract text(%s, %s)" % [@h[:text], tm[:params].join(', ')] when 3 # :UpperCaseManipulation "Upper case(%s)" % [@h[:text]] #'foo' when 4 # :LowerCaseManipulation "Lower case(%s)" % [@h[:text]] when 5 # :TrimWhitespaceManipulation "Trim whitespace(%s)" % [@h[:text]] end 'Text Manipulation' + "\n " + s.inspect #+ ' ' + @h.inspect end |