Skip to content

Instantly share code, notes, and snippets.

@cldwalker
Created January 21, 2009 20:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cldwalker/50171 to your computer and use it in GitHub Desktop.
Save cldwalker/50171 to your computer and use it in GitHub Desktop.
require 'ostruct'
class ConfigStruct < OpenStruct
def self.block_to_hash(block=nil)
config = self.new
if block
block.call(config)
config.to_hash
else
{}
end
end
def to_hash
@table
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment