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.
2120 2121 2122 2123 2124 2125 2126 2127 |
# File 'lib/ruby-macrodroid/actions.rb', line 2120 def initialize(h={}) = { } super(h) end |
Instance Method Details
#to_s(colour: false, indent: 0) ⇒ Object Also known as: to_summary
2129 2130 2131 2132 2133 2134 2135 2136 2137 2138 2139 2140 2141 2142 2143 2144 2145 2146 2147 2148 2149 2150 2151 2152 |
# File 'lib/ruby-macrodroid/actions.rb', line 2129 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 |