Class: RBI::Type::Tuple
Overview
A tuple type like ‘[String, Integer]`.
Instance Attribute Summary collapse
-
#types ⇒ Object
readonly
: Array.
Instance Method Summary collapse
-
#==(other) ⇒ Object
: (BasicObject other) -> bool.
-
#initialize(types) ⇒ Tuple
constructor
: (Array types) -> void.
-
#normalize ⇒ Object
: -> Type.
-
#simplify ⇒ Object
: -> Type.
-
#to_rbi ⇒ Object
: -> String.
Methods inherited from RBI::Type
all, any, anything, attached_class, boolean, class_of, #eql?, generic, #hash, #nilable, nilable, #nilable?, #non_nilable, noreturn, parse_node, parse_string, proc, #rbs_string, self_type, shape, simple, t_class, #to_s, tuple, type_parameter, untyped, void
Constructor Details
Instance Attribute Details
#types ⇒ Object (readonly)
: Array
591 592 593 |
# File 'lib/rbi/type.rb', line 591 def types @types end |
Instance Method Details
#==(other) ⇒ Object
: (BasicObject other) -> bool
601 602 603 |
# File 'lib/rbi/type.rb', line 601 def ==(other) Tuple === other && @types == other.types end |
#normalize ⇒ Object
: -> Type
613 614 615 |
# File 'lib/rbi/type.rb', line 613 def normalize self end |
#simplify ⇒ Object
: -> Type
619 620 621 |
# File 'lib/rbi/type.rb', line 619 def simplify self end |
#to_rbi ⇒ Object
: -> String
607 608 609 |
# File 'lib/rbi/type.rb', line 607 def to_rbi "[#{@types.map(&:to_rbi).join(", ")}]" end |