Module: CMDx::Utils::Wrap
Overview
Provides array wrapping utilities for normalizing input values into consistent array structures.
Instance Method Summary collapse
-
#array(object) ⇒ Array
Wraps an object in an array if it is not already an array.
Instance Method Details
#array(object) ⇒ Array
Wraps an object in an array if it is not already an array.
28 29 30 31 32 33 34 |
# File 'lib/cmdx/utils/wrap.rb', line 28 def array(object) case object when Array then object when NilClass then EMPTY_ARRAY else Array(object) end end |