Module: Extras::Array::ClassMethods

Defined in:
lib/extras/array.rb

Instance Method Summary collapse

Instance Method Details

#allowedObject


10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# File 'lib/extras/array.rb', line 10

def allowed
  if RUBY_VERSION < "2.4"
    @allowed ||= begin
      out = {
        :keys => [::NilClass, ::Hash, ::TrueClass, \
          ::FalseClass, ::Regexp, ::Array, ::Set, ::Fixnum,
          ::Bignum, ::Float]
      }
    end
  else
    @allowed ||= begin
      out = {
        :keys => [::NilClass, ::Hash, ::TrueClass, \
          ::FalseClass, ::Regexp, ::Array, ::Set, ::Integer, \
          ::Float]
      }
    end
  end
end