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(obj) ⇒ ToastAction
constructor
A new instance of ToastAction.
- #invoke ⇒ Object
- #to_pc ⇒ Object
- #to_s(colour: false) ⇒ Object
Methods inherited from MacroObject
Constructor Details
#initialize(obj) ⇒ ToastAction
Returns a new instance of ToastAction.
1853 1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1864 1865 1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 |
# File 'lib/ruby-macrodroid/actions.rb', line 1853 def initialize(obj) h = if obj.is_a? Hash then obj else {msg: obj} end 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
1881 1882 1883 |
# File 'lib/ruby-macrodroid/actions.rb', line 1881 def invoke() super(@h[:message_text]) end |
#to_pc ⇒ Object
1885 1886 1887 |
# File 'lib/ruby-macrodroid/actions.rb', line 1885 def to_pc() "popup_message '%s'" % @h[:message_text] end |
#to_s(colour: false) ⇒ Object
1889 1890 1891 |
# File 'lib/ruby-macrodroid/actions.rb', line 1889 def to_s(colour: false) @s = "Popup Message\n %s" % @h[:message_text] end |