Class: IceNine::RecursionGuard::Frozen
- Inherits:
-
IceNine::RecursionGuard
- Object
- IceNine::RecursionGuard
- IceNine::RecursionGuard::Frozen
- Defined in:
- lib/ice_nine/support/recursion_guard.rb
Overview
Protects against infinite recursion by not yielding with frozen objects
Instance Method Summary collapse
-
#guard(object) ⇒ Object
Guard against recursively calling a block with the same frozen object.
Instance Method Details
#guard(object) ⇒ Object
Guard against recursively calling a block with the same frozen object
49 50 51 52 |
# File 'lib/ice_nine/support/recursion_guard.rb', line 49 def guard(object) return object if object.frozen? yield end |