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, #siguid, #type

Instance Method Summary collapse

Methods inherited from MacroObject

#to_h

Constructor Details

#initialize(h = {}) ⇒ ToastAction

Returns a new instance of ToastAction.



3711
3712
3713
3714
3715
3716
3717
3718
3719
3720
3721
3722
3723
3724
3725
3726
3727
3728
3729
3730
3731
# File 'lib/ruby-macrodroid.rb', line 3711

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



3733
3734
3735
# File 'lib/ruby-macrodroid.rb', line 3733

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

#to_pcObject



3737
3738
3739
# File 'lib/ruby-macrodroid.rb', line 3737

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

#to_sObject



3741
3742
3743
# File 'lib/ruby-macrodroid.rb', line 3741

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