Class: RBI::Type::Generic
- Extended by:
- T::Sig
- Defined in:
- lib/rbi/type.rb
Overview
A generic type like ‘T::Array` or `T::Hash[Symbol, Integer]`.
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#params ⇒ Object
readonly
Returns the value of attribute params.
Instance Method Summary collapse
- #==(other) ⇒ Object
-
#initialize(name, *params) ⇒ Generic
constructor
A new instance of Generic.
- #to_rbi ⇒ Object
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_s, tuple, type_parameter, untyped, void
Constructor Details
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
283 284 285 |
# File 'lib/rbi/type.rb', line 283 def name @name end |
#params ⇒ Object (readonly)
Returns the value of attribute params.
286 287 288 |
# File 'lib/rbi/type.rb', line 286 def params @params end |
Instance Method Details
#==(other) ⇒ Object
296 297 298 |
# File 'lib/rbi/type.rb', line 296 def ==(other) Generic === other && @name == other.name && @params == other.params end |
#to_rbi ⇒ Object
301 302 303 |
# File 'lib/rbi/type.rb', line 301 def to_rbi "#{@name}[#{@params.map(&:to_rbi).join(", ")}]" end |