class Foo
 @hash = {}
 def []= (key, value)
  @hash[key] = value if yield(key)
 end
end

こんな感じで[]=にblockを引き渡すことは可能でしょうか?