Class: Array
- Inherits:
-
Object
- Object
- Array
- Defined in:
- lib/bolognese/array.rb
Overview
turn array into hash or nil, depending on array size. Reverses Array.wrap, but uses self to allow chaining with Array.wrap
Instance Method Summary collapse
Instance Method Details
#unwrap ⇒ Object
6 7 8 9 10 11 12 |
# File 'lib/bolognese/array.rb', line 6 def unwrap case self.length when 0 then nil when 1 then self.first else self end end |