Class: Yoda::Typing::Tree::LogicalOperator

Inherits:
Base
  • Object
show all
Defined in:
lib/yoda/typing/tree/logical_operator.rb

Instance Attribute Summary

Attributes inherited from Base

#context, #node

Instance Method Summary collapse

Methods inherited from Base

#build_child, #generator, #initialize

Constructor Details

This class inherits a constructor from Yoda::Typing::Tree::Base

Instance Method Details

#childrenObject



5
6
7
# File 'lib/yoda/typing/tree/logical_operator.rb', line 5

def children
  @children = node.children.map(&method(:build_child))
end

#typeObject



9
10
11
# File 'lib/yoda/typing/tree/logical_operator.rb', line 9

def type
  Types::Union.new(node.children.map { |node| infer(node) })
end