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 inherited from MacroObject
Constructor Details
#initialize(h = {}) ⇒ TextManipulationAction
Returns a new instance of TextManipulationAction.
1682 1683 1684 1685 1686 1687 1688 1689 |
# File 'lib/ruby-macrodroid/actions.rb', line 1682 def initialize(h={}) = { } super(h) end |
Instance Method Details
#to_s(colour: false, indent: 0) ⇒ Object Also known as: to_summary
1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 |
# File 'lib/ruby-macrodroid/actions.rb', line 1691 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 |