Method: Saml::Notification::ClassMethods#wrap_with_notification

Defined in:
lib/saml/notification.rb

#wrap_with_notification(method, instance_method) ⇒ Object



10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# File 'lib/saml/notification.rb', line 10

def wrap_with_notification(method, instance_method)
  wrapper = "    define_method \"\#{method}_with_notification\" do |*args|\n      notify \"\#{method}\", send(\"\#{method}_without_notification\", *args)\n    end\n\n    alias_method \"\#{method}_without_notification\", :\#{method}\n    alias_method :\#{method}, \"\#{method}_with_notification\"\n  RUBY\n\n  if instance_method\n    class_eval wrapper\n  else\n    class_eval \"class << self; \#{wrapper}; end\"\n  end\nend\n"