Method: Flyweight#initialize
- Defined in:
- lib/exegesis/flyweight.rb
#initialize(&key_processor) ⇒ Flyweight
Create an empty Flyweight with the given key-processing proc.
19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/exegesis/flyweight.rb', line 19 def initialize(&key_processor) clear! if block_given? @key_processor = key_processor else @key_processor = proc { |id| id } end self end |