Sha256: 0579270871c1ce95af6c592d28a0b625c1fcb01e3e953ec01348fe4b4ce83914
Contents?: true
Size: 283 Bytes
Versions: 212
Compression:
Stored size: 283 Bytes
Contents
# frozen_string_literal: true # turn array into hash or nil, depending on array size. # Reverses Array.wrap, but uses self to allow chaining with Array.wrap class Array def unwrap case self.length when 0 then nil when 1 then self.first else self end end end
Version data entries
212 entries across 212 versions & 2 rubygems