Class: RBI::Type::Tuple
- Extended by:
- T::Sig
- Defined in:
- lib/rbi/type.rb
Overview
A tuple type like ‘[String, Integer]`.
Instance Attribute Summary collapse
-
#types ⇒ Object
readonly
Returns the value of attribute types.
Instance Method Summary collapse
- #==(other) ⇒ Object
-
#initialize(types) ⇒ Tuple
constructor
A new instance of Tuple.
- #to_rbi ⇒ Object
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
#initialize(types) ⇒ Tuple
Returns a new instance of Tuple.
340 341 342 343 |
# File 'lib/rbi/type.rb', line 340 def initialize(types) super() @types = types end |
Instance Attribute Details
#types ⇒ Object (readonly)
Returns the value of attribute types.
337 338 339 |
# File 'lib/rbi/type.rb', line 337 def types @types end |
Instance Method Details
#==(other) ⇒ Object
346 347 348 |
# File 'lib/rbi/type.rb', line 346 def ==(other) Tuple === other && @types == other.types end |
#to_rbi ⇒ Object
351 352 353 |
# File 'lib/rbi/type.rb', line 351 def to_rbi "[#{@types.map(&:to_rbi).join(", ")}]" end |