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