Class: Steep::TypeInference::Context::MethodContext

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

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

Returns a new instance of MethodContext.



12
13
14
15
16
17
18
19
# File 'lib/steep/type_inference/context.rb', line 12

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

Instance Attribute Details

#constructorObject (readonly)

Returns the value of attribute constructor.



9
10
11
# File 'lib/steep/type_inference/context.rb', line 9

def constructor
  @constructor
end

#methodObject (readonly)

Returns the value of attribute method.



6
7
8
# File 'lib/steep/type_inference/context.rb', line 6

def method
  @method
end

#method_typeObject (readonly)

Returns the value of attribute method_type.



7
8
9
# File 'lib/steep/type_inference/context.rb', line 7

def method_type
  @method_type
end

#nameObject (readonly)

Returns the value of attribute name.



5
6
7
# File 'lib/steep/type_inference/context.rb', line 5

def name
  @name
end

#return_typeObject (readonly)

Returns the value of attribute return_type.



8
9
10
# File 'lib/steep/type_inference/context.rb', line 8

def return_type
  @return_type
end

#super_methodObject (readonly)

Returns the value of attribute super_method.



10
11
12
# File 'lib/steep/type_inference/context.rb', line 10

def super_method
  @super_method
end

Instance Method Details

#block_typeObject



21
22
23
# File 'lib/steep/type_inference/context.rb', line 21

def block_type
  method_type&.block
end