Class: Array
- Inherits:
-
Object
- Object
- Array
- Defined in:
- lib/cta_redux.rb
Class Method Summary collapse
-
.wrap(object) ⇒ Array<Object>
Encloses the object with an array, if it is not already.
Class Method Details
.wrap(object) ⇒ Array<Object>
Encloses the object with an array, if it is not already
61 62 63 64 65 66 67 68 69 |
# File 'lib/cta_redux.rb', line 61 def self.wrap(object) if object.nil? [] elsif object.respond_to?(:to_ary) object.to_ary || [object] else [object] end end |