Sha256: bb18a280bd0b8950a4fcdc7230e918e320d2714ce8a570b665552ce2e86f8a39
Contents?: true
Size: 494 Bytes
Versions: 16
Compression:
Stored size: 494 Bytes
Contents
class Hash # Turn a hash into arguments. # # h = { :list => [1,2], :base => "HI" } # h.argumentize #=> [ [], { :list => [1,2], :base => "HI" } ] # h.argumentize(:list) #=> [ [1,2], { :base => "HI" } ] # h.argumentize(:base) #=> [ ["HI"], { :list => [1,2] } ] # def argumentize(args_field=nil) config = dup if args_field args = [config.delete(args_field)].flatten.compact else args = [] end args << config return args end end
Version data entries
16 entries across 16 versions & 2 rubygems