Class: RBI::Type::Tuple
- Inherits:
-
Type
- Object
- Type
- RBI::Type::Tuple
- Defined in:
- lib/rbi/type.rb
Overview
A tuple type like [String, Integer].
Instance Attribute Summary collapse
- #types ⇒ Object readonly
Instance Method Summary collapse
- #==(other) ⇒ Object
-
#initialize(types) ⇒ Tuple
constructor
A new instance of Tuple.
- #normalize ⇒ Object
- #simplify ⇒ Object
- #to_rbi ⇒ Object
Constructor Details
#initialize(types) ⇒ Tuple
Returns a new instance of Tuple.
670 671 672 673 |
# File 'lib/rbi/type.rb', line 670 def initialize(types) super() @types = types end |
Instance Attribute Details
#types ⇒ Object (readonly)
667 668 669 |
# File 'lib/rbi/type.rb', line 667 def types @types end |
Instance Method Details
#==(other) ⇒ Object
677 678 679 |
# File 'lib/rbi/type.rb', line 677 def ==(other) Tuple === other && @types == other.types end |
#normalize ⇒ Object
689 690 691 |
# File 'lib/rbi/type.rb', line 689 def normalize self end |
#simplify ⇒ Object
695 696 697 |
# File 'lib/rbi/type.rb', line 695 def simplify self end |
#to_rbi ⇒ Object
683 684 685 |
# File 'lib/rbi/type.rb', line 683 def to_rbi "[#{@types.map(&:to_rbi).join(", ")}]" end |