Module: AroundTheWorld::ClassMethods
- Defined in:
- lib/around_the_world.rb
Instance Method Summary collapse
-
#around_method(*method_names, prevent_double_wrapping_for: nil, allow_undefined_method: false, &block) ⇒ Object
protected
if things_happened “Something happened!” else “Nothing to see here…” end end.
Instance Method Details
#around_method(*method_names, prevent_double_wrapping_for: nil, allow_undefined_method: false, &block) ⇒ Object (protected)
if things_happened
"Something happened!"
else
"Nothing to see here..."
end
end
def dont_look_in_here
do_some_things
end
end
SomeClass.new.dont_look_in_here
=> "Something happened!"
88 89 90 91 92 93 94 95 96 97 98 |
# File 'lib/around_the_world.rb', line 88 def around_method(*method_names, prevent_double_wrapping_for: nil, allow_undefined_method: false, &block) method_names.each do |method_name| MethodWrapper.wrap( method_name: method_name, target: self, prevent_double_wrapping_for: prevent_double_wrapping_for, allow_undefined_method: allow_undefined_method, &block ) end end |