A
Angel Martin
Hi all,
Is a way to make this code work:
class Hash #hash[] === hash[nil]
alias_method "_[]=","[]="
alias_method "_[]" ,"[]"
def []=(*ag)
value=ag.pop
return _[nil]=value if ag.size<1
_[*ag]=value
end
def [](*ag)
return _[nil] if ag.size<1
_[*ag]
end
end
Thanks,
Angel
Is a way to make this code work:
class Hash #hash[] === hash[nil]
alias_method "_[]=","[]="
alias_method "_[]" ,"[]"
def []=(*ag)
value=ag.pop
return _[nil]=value if ag.size<1
_[*ag]=value
end
def [](*ag)
return _[nil] if ag.size<1
_[*ag]
end
end
Thanks,
Angel