Class: Ditty::Listener
- Inherits:
-
Object
show all
- Defined in:
- lib/ditty/listener.rb
Instance Method Summary
collapse
Constructor Details
5
6
7
|
# File 'lib/ditty/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) ⇒ Object
9
10
11
12
13
14
15
|
# File 'lib/ditty/listener.rb', line 9
def method_missing(method, *args)
vals = { action: method }
return unless args[0].is_a? Hash
vals[:user] = args[0][:user] if args[0] && args[0].key?(:user)
vals[:details] = args[0][:details] if args[0] && args[0].key?(:details)
@mutex.synchronize { AuditLog.create vals }
end
|
Instance Method Details
#respond_to_missing?(_method, _include_private = false) ⇒ Boolean
17
18
19
|
# File 'lib/ditty/listener.rb', line 17
def respond_to_missing?(_method, _include_private = false)
true
end
|