Class: ToastAction
- Inherits:
-
NotificationsAction
- Object
- MacroObject
- Action
- NotificationsAction
- ToastAction
- Defined in:
- lib/ruby-macrodroid/actions.rb
Overview
Category: Notifications
Instance Attribute Summary
Attributes inherited from Action
Attributes inherited from MacroObject
Instance Method Summary collapse
-
#initialize(h = {}) ⇒ ToastAction
constructor
A new instance of ToastAction.
- #invoke ⇒ Object
- #to_pc ⇒ Object
- #to_s(colour: false) ⇒ Object
Methods inherited from MacroObject
Constructor Details
#initialize(h = {}) ⇒ ToastAction
Returns a new instance of ToastAction.
1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 |
# File 'lib/ruby-macrodroid/actions.rb', line 1575 def initialize(h={}) if h[:msg] then h[:message_text] = h[:msg] h.delete :msg end = { 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(.merge h) end |
Instance Method Details
#invoke ⇒ Object
1597 1598 1599 |
# File 'lib/ruby-macrodroid/actions.rb', line 1597 def invoke() super(@h[:message_text]) end |
#to_pc ⇒ Object
1601 1602 1603 |
# File 'lib/ruby-macrodroid/actions.rb', line 1601 def to_pc() "popup_message '%s'" % @h[:message_text] end |
#to_s(colour: false) ⇒ Object
1605 1606 1607 |
# File 'lib/ruby-macrodroid/actions.rb', line 1605 def to_s(colour: false) "Popup Message\n %s" % @h[:message_text] end |