Methods

limitΒΆ

limit(h:Hash, l:Int)

Truncate a Hash if necessary so it would have maximum l key-value pairs.
Source: stdlib.ngs:1837

h

Source hash

l

Maximum elements

Returns

Hash

Example

{"a": 1, "b": 2}.limit(1)  # {"a": 1}