Class: ToastAction
- Inherits:
-
NotificationsAction
- Object
- MacroObject
- Action
- NotificationsAction
- ToastAction
- Defined in:
- lib/ruby-macrodroid.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.
4271 4272 4273 4274 4275 4276 4277 4278 4279 4280 4281 4282 4283 4284 4285 4286 4287 4288 4289 4290 4291 |
# File 'lib/ruby-macrodroid.rb', line 4271 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
4293 4294 4295 |
# File 'lib/ruby-macrodroid.rb', line 4293 def invoke() super(@h[:message_text]) end |
#to_pc ⇒ Object
4297 4298 4299 |
# File 'lib/ruby-macrodroid.rb', line 4297 def to_pc() "popup_message '%s'" % @h[:message_text] end |
#to_s(colour: false) ⇒ Object
4301 4302 4303 |
# File 'lib/ruby-macrodroid.rb', line 4301 def to_s(colour: false) "Popup Message\n %s" % @h[:message_text] end |