Sha256: faae881221f5fa0c007d4a7dc7a6fd8cb623c15f9d8e3282535402efa0168765

Contents?: true

Size: 1.56 KB

Versions: 8

Compression:

Stored size: 1.56 KB

Contents

module RBS
  # TypeAliasDependency calculates the dependencies between type aliases
  #
  # The dependencies are normalized automatically.
  #
  class TypeAliasDependency
    attr_reader env: Environment

    # A hash table from type alias name to it's direct dependencies
    #
    # The source type name and dependencies are normalized.
    #
    attr_reader direct_dependencies: Hash[TypeName, Set[TypeName]]

    # A hash table from type alias name to a hash name with keys of transitive dependencies
    #
    # The source type name and dependencies are normalized.
    #
    attr_reader dependencies: Hash[TypeName, Hash[TypeName, bool]]

    def initialize: (env: Environment) -> void

    # Returns `true` if given type alias is circular
    #
    # Normalized given type name automatically.
    #
    def circular_definition?: (TypeName alias_name) -> bool

    # Returns the set of direct dependencies from the given type name
    #
    # Given type name will be normalized automatically.
    # Returns normalized type names.
    #
    def direct_dependencies_of: (TypeName) -> Set[TypeName]

    # Returns the set of dependencies from the given type name
    #
    # Given type name will be normalized automatically.
    # Returns normalized type names.
    #
    def dependencies_of: (TypeName) -> Set[TypeName]

    def build_dependencies: () -> void

    def transitive_closure: () -> void

    private

    def direct_dependency: (Types::t `type`, ?Set[TypeName] result) -> Set[TypeName]

    def dependency: (TypeName start, TypeName vertex, ?boolish nested) -> void
  end
end

Version data entries

8 entries across 8 versions & 2 rubygems

Version Path
rbs-3.9.0.pre.2 sig/type_alias_dependency.rbs
rbs-3.9.0.pre.1 sig/type_alias_dependency.rbs
rbs-3.9.0.dev.1 sig/type_alias_dependency.rbs
rbs-relaxed-3.9.0.1 sig/type_alias_dependency.rbs
rbs-3.8.1 sig/type_alias_dependency.rbs
rbs-3.8.0 sig/type_alias_dependency.rbs
rbs-3.8.0.pre.1 sig/type_alias_dependency.rbs
rbs-3.7.0.pre.1 sig/type_alias_dependency.rbs