Sha256: b0e71882a44c7d1fa4ba3d5399c1b07eb0be1be6d8fb9d647d97ea1dd5e7471d
Contents?: true
Size: 636 Bytes
Versions: 8
Compression:
Stored size: 636 Bytes
Contents
# frozen_string_literal: true module DiverDown module Trace class ModuleSet class ConstSourceLocationModuleSet # @param [Array<String>, Set<String>] paths def initialize(paths: []) @paths = paths.to_set end # @param [Module] mod # @return [Boolean] def include?(mod) module_name = DiverDown::Helper.normalize_module_name(mod) path, = begin Object.const_source_location(module_name) rescue NameError, TypeError nil end path && @paths.include?(path) end end end end end
Version data entries
8 entries across 8 versions & 1 rubygems