Class: Steep::TypeConstruction::MethodContext

Inherits:
Object
  • Object
show all
Defined in:
lib/steep/type_construction.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name:, method:, method_type:, return_type:, constructor:) ⇒ MethodContext

Returns a new instance of MethodContext.



46
47
48
49
50
51
52
# File 'lib/steep/type_construction.rb', line 46

def initialize(name:, method:, method_type:, return_type:, constructor:)
  @name = name
  @method = method
  @return_type = return_type
  @method_type = method_type
  @constructor = constructor
end

Instance Attribute Details

#constructorObject (readonly)

Returns the value of attribute constructor.



44
45
46
# File 'lib/steep/type_construction.rb', line 44

def constructor
  @constructor
end

#methodObject (readonly)

Returns the value of attribute method.



41
42
43
# File 'lib/steep/type_construction.rb', line 41

def method
  @method
end

#method_typeObject (readonly)

Returns the value of attribute method_type.



42
43
44
# File 'lib/steep/type_construction.rb', line 42

def method_type
  @method_type
end

#nameObject (readonly)

Returns the value of attribute name.



40
41
42
# File 'lib/steep/type_construction.rb', line 40

def name
  @name
end

#return_typeObject (readonly)

Returns the value of attribute return_type.



43
44
45
# File 'lib/steep/type_construction.rb', line 43

def return_type
  @return_type
end

Instance Method Details

#block_typeObject



54
55
56
# File 'lib/steep/type_construction.rb', line 54

def block_type
  method_type&.block
end

#super_methodObject



58
59
60
# File 'lib/steep/type_construction.rb', line 58

def super_method
  method&.super_method
end