Method: Flyweight#register

Defined in:
lib/exegesis/flyweight.rb

#register(instance) ⇒ Object

Register an instance in the flyweight.

Parameters:

  • instance (Object)

    the instance to register in the flyweight

Returns:

  • (Object)

    the instance given



46
47
48
49
# File 'lib/exegesis/flyweight.rb', line 46

def register(instance)
  key = build_key(instance)
  key_registry[key] = instance
end