Class: Array
- Inherits:
-
Object
- Object
- Array
- Defined in:
- lib/sandthorn_sequel_projection/utilities/core_extensions/array_wrap.rb
Overview
Copied from ActiveSupport github.com/rails/rails/blob/master/activesupport/lib/active_support/core_ext/array/wrap.rb
Class Method Summary collapse
Class Method Details
.wrap(object) ⇒ Object
4 5 6 7 8 9 10 11 12 |
# File 'lib/sandthorn_sequel_projection/utilities/core_extensions/array_wrap.rb', line 4 def self.wrap(object) if object.nil? [] elsif object.respond_to?(:to_ary) object.to_ary || [object] else [object] end end |