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.
316 317 318 319 |
# File 'lib/notifyhub.rb', line 316 def initialize( &action ) @action = action @enable = true end |
Instance Attribute Details
#enable(value) ⇒ Object (readonly)
Enable/disable Notify.
310 311 312 |
# File 'lib/notifyhub.rb', line 310 def enable @enable end |
Instance Method Details
#notify(*args) ⇒ Object
Perform notification action if enabled.
325 326 327 328 329 |
# File 'lib/notifyhub.rb', line 325 def notify( *args ) if @enable @action.yield( *args ) end end |