L
Larry Fast
I created a child class of Hash and would like to internalize the
equivalent of Hash.new {|hash,key| } The following code failed:
class X < Hash
def initialize
super { |hash,key| ... }
end
end
Any suggestions? I suppose I could do it externally with a create()
wrapper but it doesn't seem very pragmatic.
def create_X
y = X.new {|hash,key| ... }
return y
end
My overall goal is to record a list of attempts to read undefined Keys.
Thanks,
Larry
equivalent of Hash.new {|hash,key| } The following code failed:
class X < Hash
def initialize
super { |hash,key| ... }
end
end
Any suggestions? I suppose I could do it externally with a create()
wrapper but it doesn't seem very pragmatic.
def create_X
y = X.new {|hash,key| ... }
return y
end
My overall goal is to record a list of attempts to read undefined Keys.
Thanks,
Larry