class TypeProf::Core::AST::SigFuncType::SigTyAliasNode::SigTyUnionNode - typeprof: Ruby Standard Library Documentation

# class TypeProf::Core::AST::SigFuncType::SigTyAliasNode::SigTyUnionNode

### Attributes

types[R]

### Public Class Methods

new(raw_decl, lenv) click to toggle source
Calls superclass method `TypeProf::Core::AST::Node::new`

    # File typeprof-0.30.1/lib/typeprof/core/ast/sig_type.rb, line 293
    def initialize(raw_decl, lenv)
      super(raw_decl, lenv)
      @types = (raw_decl.types || []).map {|type| AST.create_rbs_type(type, lenv) }
    end

### Public Instance Methods

contravariant_vertex0(genv, changes, vtx, subst) click to toggle source

    # File typeprof-0.30.1/lib/typeprof/core/ast/sig_type.rb, line 308
    def contravariant_vertex0(genv, changes, vtx, subst)
      @types.each do |type|
        type.contravariant_vertex0(genv, changes, vtx, subst)
      end
    end

covariant_vertex0(genv, changes, vtx, subst) click to toggle source

    # File typeprof-0.30.1/lib/typeprof/core/ast/sig_type.rb, line 302
    def covariant_vertex0(genv, changes, vtx, subst)
      @types.each do |type|
        type.covariant_vertex0(genv, changes, vtx, subst)
      end
    end

show() click to toggle source

    # File typeprof-0.30.1/lib/typeprof/core/ast/sig_type.rb, line 314
    def show
      @types.map {|ty| ty.show }.join(" | ")
    end

subnodes(= { types: }) click to toggle source

    # File typeprof-0.30.1/lib/typeprof/core/ast/sig_type.rb, line 300
      def subnodes = { types: }

      def covariant_vertex0(genv, changes, vtx, subst)
        @types.each do |type|
          type.covariant_vertex0(genv, changes, vtx, subst)
        end
      end

      def contravariant_vertex0(genv, changes, vtx, subst)
        @types.each do |type|
          type.contravariant_vertex0(genv, changes, vtx, subst)
        end
      end

      def show
        @types.map {|ty| ty.show }.join(" | ")
      end
    end