Class: RBI::Type::Module

Inherits:
RBI::Type show all
Defined in:
lib/rbi/type.rb

Overview

The module of another type like ‘T::Module`.

Instance Attribute Summary collapse

Instance Method Summary collapse

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, t_module, #to_s, tuple, type_alias, type_parameter, untyped, void

Constructor Details

#initialize(type) ⇒ Module

: (Type type) -> void



283
284
285
286
# File 'lib/rbi/type.rb', line 283

def initialize(type)
  super()
  @type = type
end

Instance Attribute Details

#typeObject (readonly)

: Type



280
281
282
# File 'lib/rbi/type.rb', line 280

def type
  @type
end

Instance Method Details

#==(other) ⇒ Object

: (BasicObject other) -> bool



290
291
292
# File 'lib/rbi/type.rb', line 290

def ==(other)
  Module === other && @type == other.type
end

#normalizeObject

: -> Type



302
303
304
# File 'lib/rbi/type.rb', line 302

def normalize
  self
end

#simplifyObject

: -> Type



308
309
310
# File 'lib/rbi/type.rb', line 308

def simplify
  self
end

#to_rbiObject

: -> String



296
297
298
# File 'lib/rbi/type.rb', line 296

def to_rbi
  "T::Module[#{@type}]"
end