This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# What is it with you people and your singletons? | |
class Hash | |
def self.from_block(&block) | |
Hash[*BlockBuilder.new(&block).collected] | |
end | |
class BlockBuilder | |
attr_reader :collected |