Sha256: dda36459eda6625a3506fb51281fc22231eea17f862487819cc5286f52546686
Contents?: true
Size: 567 Bytes
Versions: 152
Compression:
Stored size: 567 Bytes
Contents
module ActiveSupport #:nodoc: module CoreExtensions #:nodoc: module Array #:nodoc: module Wrapper # Wraps the object in an Array unless it's an Array. Converts the # object to an Array using #to_ary if it implements that. def wrap(object) case object when nil [] when self object else if object.respond_to?(:to_ary) object.to_ary else [object] end end end end end end end
Version data entries
152 entries across 121 versions & 15 rubygems