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.



4263
4264
4265
4266
4267
4268
4269
4270
4271
4272
4273
4274
4275
4276
4277
4278
4279
4280
4281
4282
4283
# File 'lib/ruby-macrodroid.rb', line 4263

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



4285
4286
4287
# File 'lib/ruby-macrodroid.rb', line 4285

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

#to_pcObject



4289
4290
4291
# File 'lib/ruby-macrodroid.rb', line 4289

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

#to_s(colour: false) ⇒ Object



4293
4294
4295
# File 'lib/ruby-macrodroid.rb', line 4293

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