Class: Yoda::Typing::Tree::Method
  
  
  
  
  
    - Inherits:
- 
      Base
      
        
          - Object
- Base
- Yoda::Typing::Tree::Method
 show all
    - Defined in:
- lib/yoda/typing/tree/method.rb
 
  Instance Attribute Summary
  
  Attributes inherited from Base
  #context, #node
  
    
      Instance Method Summary
      collapse
    
    
  
  
  
  
  
  
  
  
  
  Methods inherited from Base
  #build_child, #children, #generator, #initialize
  
    Instance Method Details
    
      
  
  
    #argument  ⇒ Object 
  
  
  
  
    | 
9
10
11 | # File 'lib/yoda/typing/tree/method.rb', line 9
def argument
  @argument ||= build_child(node.children[1])
end | 
 
    
      
  
  
    #body  ⇒ Object 
  
  
  
  
    | 
13
14
15 | # File 'lib/yoda/typing/tree/method.rb', line 13
def body
  @body ||= node.children[2] && build_child(node.children[2], context: method_context)
end | 
 
    
      
  
  
    #method_context  ⇒ Object 
  
  
  
  
    | 
26
27
28 | # File 'lib/yoda/typing/tree/method.rb', line 26
def method_context
  @method_context ||= method_definition_provider.generate_method_context(context: context, args_node: args_node)
end | 
 
    
      
  
  
    #name  ⇒ Object 
  
  
  
  
    | 
5
6
7 | # File 'lib/yoda/typing/tree/method.rb', line 5
def name
  node.children.first
end | 
 
    
      
  
  
    #receiver_type  ⇒ Object 
  
  
  
  
    | 
22
23
24 | # File 'lib/yoda/typing/tree/method.rb', line 22
def receiver_type
  @receiver_type ||= generator.union(context.current_objects.map { |object| generator.object_type(object) })
end | 
 
    
      
  
  
    | 
18
19
20 | # File 'lib/yoda/typing/tree/method.rb', line 18
def type
  @type ||= generator.symbol_type
end |