Module: Herald::Watcher::Notifier::Callback

Defined in:
lib/herald/notifiers/callback.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#procObject (readonly)

Returns the value of attribute proc.



7
8
9
# File 'lib/herald/notifiers/callback.rb', line 7

def proc
  @proc
end

Instance Method Details

#notify(item) ⇒ Object



16
17
18
19
20
21
22
# File 'lib/herald/notifiers/callback.rb', line 16

def notify(item)
  if @proc.arity == 1
    @proc.call(item)
  else
    @proc.call
  end
end

#parse_options(options) ⇒ Object

no options for Callback



10
# File 'lib/herald/notifiers/callback.rb', line 10

def parse_options(options); end

#testObject

we can’t sandbox the proc to test it out, so just return true



14
# File 'lib/herald/notifiers/callback.rb', line 14

def test; true; end