Class: NotificationAction

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 Action

#invoke

Methods inherited from MacroObject

#to_h

Constructor Details

#initialize(h = {}) ⇒ NotificationAction

Returns a new instance of NotificationAction.



3542
3543
3544
3545
3546
3547
3548
3549
3550
3551
3552
3553
3554
3555
3556
3557
3558
3559
3560
3561
3562
3563
# File 'lib/ruby-macrodroid.rb', line 3542

def initialize(h={})
  
  h[:notification_subject] = h[:subject] if h[:subject] 
  h[:notification_text] = h[:text] if h[:text]

  options = {
    ringtone_name: 'Default',
    notification_text: '',
    notification_subject: '',
    macro_guid_to_run: 0,
    notification_channel_type: 0,
    image_resource_id: 0,
    overwrite_existing: false,
    priority: 0,
    ringtone_index: 0,
    icon_bg_color: -1762269,
    run_macro_when_pressed: false
  }

  super(options.merge filter(options, h))

end

Instance Method Details

#to_sObject



3565
3566
3567
# File 'lib/ruby-macrodroid.rb', line 3565

def to_s()
  'Display Notification: ' + "%s: %s" % [@h[:notification_subject], @h[:notification_text]]
end