Module: Utils::Array

Defined in:
lib/csp/utils.rb

Class Method Summary collapse

Class Method Details

.wrap(object) ⇒ Object



5
6
7
8
9
10
11
12
13
# File 'lib/csp/utils.rb', line 5

def self.wrap(object)
  if object.nil?
    []
  elsif object.respond_to?(:to_ary)
    object.to_ary || [object]
  else
    [object]
  end
end