Class: IncomingCallTrigger
- Inherits:
-
Trigger
- Object
- MacroObject
- Trigger
- IncomingCallTrigger
- Defined in:
- lib/ruby-macrodroid/triggers.rb
Overview
Category: Call/SMS
Instance Attribute Summary
Attributes inherited from Trigger
Attributes inherited from MacroObject
Instance Method Summary collapse
-
#initialize(h = {}) ⇒ IncomingCallTrigger
constructor
A new instance of IncomingCallTrigger.
- #to_s(colour: false) ⇒ Object (also: #to_summary)
Methods inherited from Trigger
Methods inherited from MacroObject
Constructor Details
#initialize(h = {}) ⇒ IncomingCallTrigger
Returns a new instance of IncomingCallTrigger.
276 277 278 279 280 281 282 283 284 285 286 287 288 |
# File 'lib/ruby-macrodroid/triggers.rb', line 276 def initialize(h={}) = { 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(.merge h) end |
Instance Method Details
#to_s(colour: false) ⇒ Object Also known as: to_summary
290 291 292 293 |
# File 'lib/ruby-macrodroid/triggers.rb', line 290 def to_s(colour: false) caller = @h[:incoming_call_from_list].map {|x| "%s" % x[:name]}.join(', ') "Call Incoming [%s]" % caller end |