class IceNine::RecursionGuard::Frozen

Protects against infinite recursion by not yielding with frozen objects

Public Instance Methods

guard(object) { || ... } click to toggle source

Guard against recursively calling a block with the same frozen object

@param [Object] object

@return [Object]

# File lib/ice_nine/support/recursion_guard.rb, line 48
def guard(object)
  return object if object.frozen?
  yield
end