Module: Capnotify::Plugin::Message
- Defined in:
- lib/capnotify/plugin/message.rb
Constant Summary collapse
- PLUGIN_NAME =
the plugin’s name (how it’s referenced once it’s loaded)
:capnotify_message
Instance Method Summary collapse
-
#init ⇒ Object
initialize the plugin.
-
#unload ⇒ Object
delete the component when this plugin is unloaded.
Instance Method Details
#init ⇒ Object
initialize the plugin
13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/capnotify/plugin/message.rb', line 13 def init # add a component tagged with this plugin's name capnotify.components << Capnotify::Component.new(PLUGIN_NAME) do |c| # the header c.header = 'Message' # the content # if notification_msg isn't set, content will be set to nil # nil content will prevent the section from being rendered. c.content = fetch(:notification_msg, nil) end end |
#unload ⇒ Object
delete the component when this plugin is unloaded
27 28 29 |
# File 'lib/capnotify/plugin/message.rb', line 27 def unload capnotify.delete_component PLUGIN_NAME end |