class WeakKeyHash

rubymacros - a macro preprocessor for ruby Copyright © 2008, 2016 Caleb Clausen

This program is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this program. If not, see <www.gnu.org/licenses/>.

Public Class Methods

new(&block) click to toggle source
Calls superclass method
# File lib/weakkeyhash.rb, line 20
def initialize(&block)
  super
end

Public Instance Methods

[](key) click to toggle source
Calls superclass method
# File lib/weakkeyhash.rb, line 25
def [](key)
  super key.__id__
end
[]=(key,val) click to toggle source
Calls superclass method
# File lib/weakkeyhash.rb, line 29
def []=(key,val)
  ObjectSpace.define_finalizer(key,&method :delete)
  super key.__id__,val
end