Sha256: af1752e6d000eafb414d919218addc66bcd5dbe00857bde6876e58ee165f8128
Contents?: true
Size: 373 Bytes
Versions: 2
Compression:
Stored size: 373 Bytes
Contents
class Hash # { foo: :bar }.to_hwia # # { foo: :bar }.to_hwia :foo, :bar # create struct and fill def to_hwia *args if args.first.nil? HashWia.new self else list = args.flatten name = 'DynStruct_' + list.join('_') HashWia::STRUCTS[name] ||= ::Struct.new(name, *list) HashWia::STRUCTS[name].new **self end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
hash_wia-0.9.0 | ./lib/hash_wia/pollute.rb |
hash_wia-0.8.7 | ./lib/hash_wia/pollute.rb |