Class: Yoda::Typing::Tree::MethodDef
Instance Attribute Summary
Attributes inherited from Base
#context, #tracer
Instance Method Summary
collapse
#infer_method_type
Methods inherited from Base
#build_child, #generator, #infer_child, #initialize, #inspect, #pretty_print, #type
Instance Method Details
28
29
30
|
# File 'lib/yoda/typing/tree/method_def.rb', line 28
def body_node
node.body
end
|
13
14
15
|
# File 'lib/yoda/typing/tree/method_def.rb', line 13
def infer_type
infer_method_type(receiver_type: self_type)
end
|
|
# File 'lib/yoda/typing/tree/method_def.rb', line 9
|
#node_name ⇒ Symbol
18
19
20
|
# File 'lib/yoda/typing/tree/method_def.rb', line 18
def node_name
node.name
end
|
23
24
25
|
# File 'lib/yoda/typing/tree/method_def.rb', line 23
def parameters_node
node.parameters
end
|
33
34
35
36
37
|
# File 'lib/yoda/typing/tree/method_def.rb', line 33
def self_type
@self_type ||= begin
context.method_receiver
end
end
|