Class: RBI::Type::Composite Abstract
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
: Array.
Instance Method Summary collapse
-
#==(other) ⇒ Object
: (BasicObject other) -> bool.
-
#initialize(types) ⇒ Composite
constructor
: (Array types) -> void.
Methods inherited from RBI::Type
all, any, anything, attached_class, boolean, class_of, #eql?, generic, #hash, nilable, #nilable, #nilable?, #non_nilable, noreturn, #normalize, parse_node, parse_string, proc, #rbs_string, self_type, shape, simple, #simplify, t_class, #to_rbi, #to_s, tuple, type_alias, type_parameter, untyped, void
Constructor Details
Instance Attribute Details
#types ⇒ Object (readonly)
: Array
368 369 370 |
# File 'lib/rbi/type.rb', line 368 def types @types end |
Instance Method Details
#==(other) ⇒ Object
: (BasicObject other) -> bool
378 379 380 |
# File 'lib/rbi/type.rb', line 378 def ==(other) self.class === other && @types.sort_by(&:to_rbi) == other.types.sort_by(&:to_rbi) end |