Module: Mongoid::Extensions::Array::Conversions::ClassMethods

Defined in:
lib/mongoid/extensions/array/conversions.rb

Overview

:nodoc:

Instance Method Summary collapse

Instance Method Details

#raise_or_return(value) ⇒ Object Also known as: get, set



10
11
12
13
14
15
# File 'lib/mongoid/extensions/array/conversions.rb', line 10

def raise_or_return(value)
  unless value.nil? || value.is_a?(::Array)
    raise Mongoid::Errors::InvalidType.new(::Array, value)
  end
  value
end