Class: ProxES::Listener

Inherits:
Object
  • Object
show all
Defined in:
lib/proxes/listener.rb

Instance Method Summary collapse

Constructor Details

#initializeListener

Returns a new instance of Listener.



5
6
7
# File 'lib/proxes/listener.rb', line 5

def initialize
  @mutex = Mutex.new
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(method, *args, &block) ⇒ Object



9
10
11
12
13
14
# File 'lib/proxes/listener.rb', line 9

def method_missing(method, *args, &block)
  vals = { action: method }
  vals[:user] = args[0][:user] if (args[0] && args[0].has_key?(:user))
  vals[:details] = args[0][:details] if (args[0] && args[0].has_key?(:details))
  @mutex.synchronize { AuditLog.create vals }
end

Instance Method Details

#respond_to_missing?(method, include_private = false) ⇒ Boolean

Returns:

  • (Boolean)


16
17
18
# File 'lib/proxes/listener.rb', line 16

def respond_to_missing?(method, include_private = false)
  true
end