Class: Action

Inherits:
MacroObject show all
Defined in:
lib/ruby-macrodroid.rb

Instance Attribute Summary collapse

Attributes inherited from MacroObject

#options, #type

Instance Method Summary collapse

Methods inherited from MacroObject

#to_h, #to_s

Constructor Details

#initialize(h = {}) ⇒ Action



2390
2391
2392
2393
2394
2395
2396
2397
# File 'lib/ruby-macrodroid.rb', line 2390

def initialize(h={})    
  super(h)
  
  # fetch the constraints                               
  @constraints = h[:constraint_list].map do |constraint|
    object(constraint.to_snake_case)
  end       
end

Instance Attribute Details

#constraintsObject (readonly)

Returns the value of attribute constraints.



2388
2389
2390
# File 'lib/ruby-macrodroid.rb', line 2388

def constraints
  @constraints
end

Instance Method Details

#invoke(s = '') ⇒ Object



2399
2400
2401
# File 'lib/ruby-macrodroid.rb', line 2399

def invoke(s='')    
  "%s/%s: %s" % [@group, @type, s]
end