Class: LanGrove::Behaviour::Notifiable

Inherits:
LanGrove::Base show all
Defined in:
lib/langrove/behaviour/notifiable.rb

Instance Attribute Summary

Attributes inherited from LanGrove::Base

#logger

Instance Method Summary collapse

Methods inherited from LanGrove::Base

#config_exception, #type

Constructor Details

#initialize(root, config, name) ⇒ Notifiable

Returns a new instance of Notifiable.



9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
# File 'lib/langrove/behaviour/notifiable.rb', line 9

def initialize( root, config, name )
  
  @requires = {
    
    #
    # Notifier requires a Notifier plugin.
    #
    :notifier => {
   
      :actions => [
             
        #
        # Plugin should implement:
        # 
        # result = <Plugin>.notify( handler )
        # 
        # To generate a notification
        # 
        # - (on success) Should return true.
        # - (on failed)  Should return false.  
        # 
        :notify
        
      ],
      
      :version => NOTIFIABLE_VERSION
      
    }
    
  } if @requires.nil?
  
  super
  
end