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.
2574 2575 2576 2577 2578 2579 2580 2581 2582 2583 |
# File 'lib/ruby-macrodroid.rb', line 2574 def initialize(h={}) = { a: true, constraint_list: '' } super(.merge h) end |
Instance Method Details
#to_s ⇒ Object
2585 2586 2587 2588 2589 2590 2591 2592 |
# File 'lib/ruby-macrodroid.rb', line 2585 def to_s() operator = @h[:is_or_condition] ? 'OR' : 'AND' r = 'If ' + @constraints.map(&:to_s).join(" %s " % operator) puts 'if ... @h ' + @h.inspect r end |