Sha256: 8dd2de4a36f5339f814010a93318c723a573e9c1c1d1227aff48a419c0888551
Contents?: true
Size: 489 Bytes
Versions: 29
Compression:
Stored size: 489 Bytes
Contents
# typed: true # Copyright (c) 2015 Sqreen. All Rights Reserved. # Please refer to our terms for more information: https://www.sqreen.com/terms.html module Sqreen module Dependency def self.const_exist?(name) resolve_const(name) && true rescue NameError, ArgumentError false end def self.resolve_const(name) raise ArgumentError if name.nil? || name.empty? name.to_s.split('::').inject(Object) { |a, e| a.const_get(e, false) } end end end
Version data entries
29 entries across 29 versions & 1 rubygems