Class: RBI::Type::Composite Abstract
- Inherits:
-
Type
- Object
- Type
- RBI::Type::Composite
- Defined in:
- lib/rbi/type.rb
Overview
This class is abstract.
A type that is composed of multiple types like T.all(String, Integer).
Instance Attribute Summary collapse
- #types ⇒ Object readonly
Instance Method Summary collapse
- #==(other) ⇒ Object
-
#initialize(types) ⇒ Composite
constructor
A new instance of Composite.
Constructor Details
#initialize(types) ⇒ Composite
Returns a new instance of Composite.
407 408 409 410 |
# File 'lib/rbi/type.rb', line 407 def initialize(types) super() @types = types end |
Instance Attribute Details
#types ⇒ Object (readonly)
404 405 406 |
# File 'lib/rbi/type.rb', line 404 def types @types end |
Instance Method Details
#==(other) ⇒ Object
414 415 416 |
# File 'lib/rbi/type.rb', line 414 def ==(other) self.class === other && @types.sort_by(&:to_rbi) == other.types.sort_by(&:to_rbi) end |