Sha256: 08920863e0aa845766a9d472c943a0a166950d8c541f8311c3d96f8279a25fd3

Contents?: true

Size: 466 Bytes

Versions: 16

Compression:

Stored size: 466 Bytes

Contents

# Copyright (c) 2015 Sqreen. All Rights Reserved.
# Please refer to our terms for more information: https://www.sqreen.io/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) }
    end
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
sqreen-1.18.1-java lib/sqreen/dependency.rb
sqreen-1.18.1 lib/sqreen/dependency.rb
sqreen-1.18.0-java lib/sqreen/dependency.rb
sqreen-1.18.0 lib/sqreen/dependency.rb
sqreen-1.17.2-java lib/sqreen/dependency.rb
sqreen-1.17.2 lib/sqreen/dependency.rb
sqreen-1.17.2.rc1-java lib/sqreen/dependency.rb
sqreen-1.17.2.rc1 lib/sqreen/dependency.rb
sqreen-1.17.2.beta4-java lib/sqreen/dependency.rb
sqreen-1.17.2.beta4 lib/sqreen/dependency.rb
sqreen-1.17.2.beta3-java lib/sqreen/dependency.rb
sqreen-1.17.2.beta3 lib/sqreen/dependency.rb
sqreen-1.17.2.beta2-java lib/sqreen/dependency.rb
sqreen-1.17.2.beta2 lib/sqreen/dependency.rb
sqreen-1.17.2.beta1-java lib/sqreen/dependency.rb
sqreen-1.17.2.beta1 lib/sqreen/dependency.rb