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:, super_method:, forward_arg_type:, block_param_name: nil) ⇒ MethodContext

Returns a new instance of MethodContext.



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

def initialize(name:, method:, method_type:, return_type:, super_method:, forward_arg_type:, block_param_name: nil)
  @name = name
  @method = method
  @return_type = return_type
  @method_type = method_type
  @super_method = super_method
  @forward_arg_type = forward_arg_type
  @block_param_name = block_param_name
end

Instance Attribute Details

#block_param_nameObject (readonly)

Returns the value of attribute block_param_name.



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

def block_param_name
  @block_param_name
end

#forward_arg_typeObject (readonly)

Returns the value of attribute forward_arg_type.



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

def forward_arg_type
  @forward_arg_type
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.



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

def super_method
  @super_method
end

Instance Method Details

#attribute_setter?Boolean

Returns:

  • (Boolean)


27
28
29
# File 'lib/steep/type_inference/context.rb', line 27

def attribute_setter?
  name.to_s.end_with?('=')
end

#block_typeObject



23
24
25
# File 'lib/steep/type_inference/context.rb', line 23

def block_type
  method_type&.block
end