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