Class: RBI::Type::Composite
- Extended by:
- T::Helpers
- Defined in:
- lib/rbi/type.rb
Overview
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, parse_node, parse_string, proc, #rbs_string, self_type, shape, simple, t_class, #to_rbi, #to_s, tuple, type_parameter, untyped, void
Constructor Details
Instance Attribute Details
#types ⇒ Object (readonly)
: Array
236 237 238 |
# File 'lib/rbi/type.rb', line 236 def types @types end |
Instance Method Details
#==(other) ⇒ Object
: (BasicObject other) -> bool
246 247 248 |
# File 'lib/rbi/type.rb', line 246 def ==(other) self.class === other && @types.sort_by(&:to_rbi) == other.types.sort_by(&:to_rbi) end |