Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
|
|
@ -0,0 +1,6 @@
|
|||
def keys = ['a','b','c']
|
||||
def vals = ['aaa', 'bbb', 'ccc']
|
||||
def hash = [:]
|
||||
keys.eachWithIndex { key, i ->
|
||||
hash[key] = vals[i]
|
||||
}
|
||||
|
|
@ -0,0 +1 @@
|
|||
List.metaClass.hash = { list -> [delegate, list].transpose().collectEntries { [(it[0]): it[1]] } }
|
||||
|
|
@ -0,0 +1 @@
|
|||
assert (['a', 'b', 'c'].hash(['aaa', 'bbb', 'ccc'])) == [a: 'aaa', b: 'bbb', c: 'ccc']
|
||||
Loading…
Add table
Add a link
Reference in a new issue