Module: Veritas::Immutable::ModuleMethods

Defined in:
lib/veritas/support/immutable.rb

Overview

Methods mixed in to immutable modules

Instance Method Summary collapse

Instance Method Details

#included(mod) ⇒ self

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Hook called when module is included

Parameters:

  • mod (Module)

    the module including ModuleMethods

Returns:

  • (self)


158
159
160
161
# File 'lib/veritas/support/immutable.rb', line 158

def included(mod)
  Immutable.included(mod)
  self
end

#memoize(*methods) ⇒ self

Memoize a list of methods

Examples:

memoize :hash

Parameters:

  • *methods (Array<#to_s>)

    a list of methods to memoize

Returns:

  • (self)


174
175
176
177
# File 'lib/veritas/support/immutable.rb', line 174

def memoize(*methods)
  methods.each { |method| memoize_method(method) }
  self
end