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.



3331
3332
3333
3334
3335
3336
3337
3338
3339
3340
3341
3342
3343
3344
3345
3346
3347
3348
3349
3350
3351
# File 'lib/ruby-macrodroid.rb', line 3331

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

#invoke ⇒ Object



3353
3354
3355
# File 'lib/ruby-macrodroid.rb', line 3353

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

#to_pc ⇒ Object



3357
3358
3359
# File 'lib/ruby-macrodroid.rb', line 3357

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

#to_s ⇒ Object



3361
3362
3363
# File 'lib/ruby-macrodroid.rb', line 3361

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