Class: IncomingCallTrigger

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

Overview

Category: Call/SMS

Instance Attribute Summary

Attributes inherited from Trigger

#constraints

Attributes inherited from MacroObject

#options, #siguid, #type

Instance Method Summary collapse

Methods inherited from Trigger

#match?

Methods inherited from MacroObject

#to_h

Constructor Details

#initialize(h = {}) ⇒ IncomingCallTrigger

Returns a new instance of IncomingCallTrigger.



293
294
295
296
297
298
299
300
301
302
303
304
305
# File 'lib/ruby-macrodroid/triggers.rb', line 293

def initialize(h={})

  options = {
    incoming_call_from_list: [{:m_id=>"-2", :m_lookupKey=>"-2", :m_name=>"[Any Number]"}],
    group_id_list: [],
    group_name_list: [],
    option: 0,
    phone_number_exclude: false
  }

  super(options.merge h)

end

Instance Method Details

#to_s(colour: false) ⇒ Object Also known as: to_summary



307
308
309
310
# File 'lib/ruby-macrodroid/triggers.rb', line 307

def to_s(colour: false)
  caller = @h[:incoming_call_from_list].map {|x| "%s" % x[:name]}.join(', ')
  "Call Incoming [%s]" % caller
end