Sha256: a6fba24d4a5c1617ebdbe7a0d9574db0902fa4f4cc95094f140fad15fb4cdbbe
Contents?: true
Size: 600 Bytes
Versions: 59
Compression:
Stored size: 600 Bytes
Contents
module OodCore # Namespace for Ruby refinements module Refinements # This module provides refinements for manipulating the Ruby {Array} class. module ArrayExtensions # Wrap its argument in an array unless it is already an array (or # array-like) # @see http://apidock.com/rails/Array/wrap/class refine Array.singleton_class do def wrap(object) if object.nil? [] elsif object.respond_to?(:to_ary) object.to_ary || [object] else [object] end end end end end end
Version data entries
59 entries across 59 versions & 1 rubygems