Class: Notify
- Inherits:
-
Object
- Object
- Notify
- Defined in:
- lib/notifyhub.rb
Overview
Notify object including disable/enable possibility.
Instance Attribute Summary collapse
-
#enable(value) ⇒ Object
readonly
Enable/disable Notify.
Instance Method Summary collapse
-
#initialize(&action) ⇒ Notify
constructor
Instantiation.
-
#notify(*args) ⇒ Object
Perform notification action if enabled.
Constructor Details
#initialize(&action) ⇒ Notify
Instantiation.
339 340 341 342 |
# File 'lib/notifyhub.rb', line 339 def initialize( &action ) @action = action @enable = true end |
Instance Attribute Details
#enable(value) ⇒ Object (readonly)
Enable/disable Notify.
333 334 335 |
# File 'lib/notifyhub.rb', line 333 def enable @enable end |
Instance Method Details
#notify(*args) ⇒ Object
Perform notification action if enabled.
348 349 350 351 352 |
# File 'lib/notifyhub.rb', line 348 def notify( *args ) if @enable @action.yield( *args ) end end |