Class: ToastAction

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

Overview

Category: Notifications

Instance Attribute Summary

Attributes inherited from Action

#constraints

Attributes inherited from MacroObject

#options, #type

Instance Method Summary collapse

Methods inherited from MacroObject

#to_h

Constructor Details

#initialize(h = {}) ⇒ ToastAction

Returns a new instance of ToastAction.



3575
3576
3577
3578
3579
3580
3581
3582
3583
3584
3585
3586
3587
3588
3589
3590
3591
3592
3593
3594
3595
# File 'lib/ruby-macrodroid.rb', line 3575

def initialize(h={})

  if h[:msg] then
    h[:message_text] = h[:msg]
    h.delete :msg
  end
  
  options = {
    message_text: '',
    image_resource_name: 'launcher_no_border',
    image_package_name: 'com.arlosoft.macrodroid',
    image_name: 'launcher_no_border',
    duration: 0,
    display_icon: true,
    background_color: -12434878,
    position: 0
  }

  super(options.merge h)

end

Instance Method Details

#invokeObject



3597
3598
3599
# File 'lib/ruby-macrodroid.rb', line 3597

def invoke()
  super(@h[:message_text])
end

#to_pcObject



3601
3602
3603
# File 'lib/ruby-macrodroid.rb', line 3601

def to_pc()
  "popup_message '%s'" % @h[:message_text]
end

#to_sObject



3605
3606
3607
# File 'lib/ruby-macrodroid.rb', line 3605

def to_s()
  "Popup Message '%s'" % @h[:message_text]
end