class SyntaxTree::Reflection::Type::TupleType
Represents a tuple type that holds a number of types in order.
Attributes
Public Class Methods
Source
# File lib/syntax_tree/reflection.rb, line 34 def initialize(types) @types = types end
Public Instance Methods
Source
# File lib/syntax_tree/reflection.rb, line 38 def ===(value) value.is_a?(Array) && value.length == types.length && value.zip(types).all? { |item, type| type === item } end
Source
# File lib/syntax_tree/reflection.rb, line 43 def inspect "[#{types.map(&:inspect).join(", ")}]" end