Class: IfConditionAction
- Inherits:
-
Action
- Object
- MacroObject
- Action
- IfConditionAction
- Defined in:
- lib/ruby-macrodroid.rb
Instance Attribute Summary
Attributes inherited from Action
Attributes inherited from MacroObject
Instance Method Summary collapse
-
#initialize(h = {}) ⇒ IfConditionAction
constructor
A new instance of IfConditionAction.
- #to_s ⇒ Object
Methods inherited from Action
Methods inherited from MacroObject
Constructor Details
#initialize(h = {}) ⇒ IfConditionAction
Returns a new instance of IfConditionAction.
2661 2662 2663 2664 2665 2666 2667 2668 2669 2670 2671 2672 2673 |
# File 'lib/ruby-macrodroid.rb', line 2661 def initialize(h={}) = { a: true, constraint_list: '' } macro = h[:macro] h2 = .merge(filter(,h).merge(macro: macro)) super(h2) end |
Instance Method Details
#to_s ⇒ Object
2675 2676 2677 2678 2679 2680 |
# File 'lib/ruby-macrodroid.rb', line 2675 def to_s() operator = @h[:is_or_condition] ? 'OR' : 'AND' 'If ' + @constraints.map(&:to_s).join(" %s " % operator) end |