Class: ToastAction

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

Overview

Category: Notifications

Instance Attribute Summary

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.



3428
3429
3430
3431
3432
3433
3434
3435
3436
3437
3438
3439
3440
3441
3442
3443
3444
3445
3446
3447
3448
# File 'lib/ruby-macrodroid.rb', line 3428

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



3450
3451
3452
# File 'lib/ruby-macrodroid.rb', line 3450

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

#to_pcObject



3454
3455
3456
# File 'lib/ruby-macrodroid.rb', line 3454

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

#to_sObject



3458
3459
3460
# File 'lib/ruby-macrodroid.rb', line 3458

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