module OodCore::Refinements::ArrayExtensions

This module provides refinements for manipulating the Ruby {Array} class.

Public Instance Methods

wrap(object) click to toggle source
# File lib/ood_core/refinements/array_extensions.rb, line 10
def wrap(object)
  if object.nil?
    []
  elsif object.respond_to?(:to_ary)
    object.to_ary || [object]
  else
    [object]
  end
end