class SyntaxTree::Reflection::Type::UnionType
Represents a union type that can be one of a number of types.
Attributes
Public Class Methods
Source
# File lib/syntax_tree/reflection.rb, line 52 def initialize(types) @types = types end
Public Instance Methods
Source
# File lib/syntax_tree/reflection.rb, line 56 def ===(value) types.any? { _1 === value } end
Source
# File lib/syntax_tree/reflection.rb, line 60 def inspect types.map(&:inspect).join(" | ") end