Class: IfConditionAction
- Inherits:
-
Action
- Object
- MacroObject
- Action
- IfConditionAction
- Defined in:
- lib/ruby-macrodroid/actions.rb
Overview
Conditions/Loops
Instance Attribute Summary
Attributes inherited from Action
Attributes inherited from MacroObject
Instance Method Summary collapse
-
#initialize(obj = nil) ⇒ IfConditionAction
constructor
A new instance of IfConditionAction.
- #to_s(colour: false) ⇒ Object
Methods inherited from Action
Methods inherited from MacroObject
Constructor Details
#initialize(obj = nil) ⇒ IfConditionAction
Returns a new instance of IfConditionAction.
359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 |
# File 'lib/ruby-macrodroid/actions.rb', line 359 def initialize(obj=nil) h = if obj.is_a? Hash then obj else # get the constraints end = { a: true, constraint_list: '' } macro = h[:macro] h2 = .merge(filter(,h).merge(macro: macro)) super(h2) @label = 'If ' end |
Instance Method Details
#to_s(colour: false) ⇒ Object
382 383 384 385 386 387 |
# File 'lib/ruby-macrodroid/actions.rb', line 382 def to_s(colour: false) @s = "If " #+ @constraints.map(&:to_s).join(" %s " % operator) super(colour: colour) end |