Method: MethodDisabling::DisabledMethod#execute
- Defined in:
- lib/method_disabling.rb
#execute(object, *args, &block) ⇒ Object
The replacement for the original method. It will raise a NoMethodError if the method is disabled. Otherwise, it will execute the original method.
135 136 137 138 139 140 141 |
# File 'lib/method_disabling.rb', line 135 def execute(object, *args, &block) if disabled? raise NoMethodError, else object.send(aliased_name, *args, &block) end end |