Class: Array

Inherits:
Object
  • Object
show all
Defined in:
lib/bbc/extensions/array.rb

Class Method Summary collapse

Class Method Details

.wrap(object) ⇒ Object



2
3
4
5
6
7
8
9
10
# File 'lib/bbc/extensions/array.rb', line 2

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