Class: TextManipulationAction
- Inherits:
-
Action
- Object
- MacroObject
- Action
- 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.
1843 1844 1845 1846 1847 1848 1849 1850 |
# File 'lib/ruby-macrodroid/actions.rb', line 1843 def initialize(h={}) = { } super(h) end |
Instance Method Details
#to_s(colour: false, indent: 0) ⇒ Object Also known as: to_summary
1852 1853 1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1864 1865 1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 |
# File 'lib/ruby-macrodroid/actions.rb', line 1852 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 |