Class: RBI::Type::Composite
- Extended by:
- T::Helpers, T::Sig
- 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
Returns the value of attribute types.
Instance Method Summary collapse
- #==(other) ⇒ Object
-
#initialize(types) ⇒ Composite
constructor
A new instance of Composite.
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
#initialize(types) ⇒ Composite
Returns a new instance of Composite.
240 241 242 243 |
# File 'lib/rbi/type.rb', line 240 def initialize(types) super() @types = types end |
Instance Attribute Details
#types ⇒ Object (readonly)
Returns the value of attribute types.
237 238 239 |
# File 'lib/rbi/type.rb', line 237 def types @types end |
Instance Method Details
#==(other) ⇒ Object
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 |