class Notify

Notify object including disable/enable possibility.

Attributes

enable[R]

Enabled/disabled status.

Public Class Methods

new( &action ) click to toggle source

Instantiation.

@param action [Proc] Notification action.

# File lib/notifyhub.rb, line 339
def initialize( &action )
    @action = action
    @enable = true
end

Public Instance Methods

notify( *args ) click to toggle source

Perform notification action if enabled.

@param args [Array<Object>] Data provided to action.

# File lib/notifyhub.rb, line 348
def notify( *args )
    if @enable
        @action.yield( *args )
    end
end