module Adamantium::Mutable

Module fake frozen object

This behavior sometimes is needed when a mutable object needs to be referenced in an inmutable object tree.

If you have to use `memoize :foo, freezer: :noop` to often you might want to include this module into your class.

Use wisely! A rule of thumb only a tiny fraction of your objects typically deserves this.

Public Instance Methods

freeze() click to toggle source

Noop freezer

@example

class DoesNotGetFrozen
  include Adamantium::Mutable
end

instance = DoesNotGetFrozen
instance.freeze # => instance

@return [self]

@api public

# File lib/adamantium/mutable.rb, line 32
def freeze
  self
end
frozen?() click to toggle source

Test if object is frozen

@example

class DoesNotGetFrozen
  include Adamantium::Mutable
end

instance = DoesNotGetFrozen
instance.frozen? # => true

@return [true]

@api public

# File lib/adamantium/mutable.rb, line 50
def frozen?
  true
end