Class: Yoda::Typing::Tree::Base
Abstract
- Inherits:
-
Object
- Object
- Yoda::Typing::Tree::Base
show all
- Defined in:
- lib/yoda/typing/tree/base.rb
Overview
Direct Known Subclasses
Begin, Block, Case, ClassTree, Const, ConstantAssignment, Escape, For, HashBody, If, Literal, LiteralWithInterpolation, LogicalAssignment, LogicalOperator, Method, ModuleTree, MultipleAssignment, RescueBody, Self, Send, SingletonMethod, Super, Variable, VariableAssignment, While, Yield
Instance Attribute Summary collapse
Instance Method Summary
collapse
Constructor Details
#initialize(node:, context:, parent: nil) ⇒ Base
Returns a new instance of Base.
15
16
17
18
19
|
# File 'lib/yoda/typing/tree/base.rb', line 15
def initialize(node:, context:, parent: nil)
@node = node
@context = context
@parent = parent
end
|
Instance Attribute Details
#context ⇒ BaseContext
10
11
12
|
# File 'lib/yoda/typing/tree/base.rb', line 10
def context
@context
end
|
#node ⇒ ::AST::Node
7
8
9
|
# File 'lib/yoda/typing/tree/base.rb', line 7
def node
@node
end
|
Instance Method Details
#build_child(node, context: nil) ⇒ Base
40
41
42
|
# File 'lib/yoda/typing/tree/base.rb', line 40
def build_child(node, context: nil)
Tree.build(node, context: context, parent: self)
end
|
#children ⇒ Array<Base>
23
24
25
|
# File 'lib/yoda/typing/tree/base.rb', line 23
def children
fail NotImplementedError
end
|
34
35
36
|
# File 'lib/yoda/typing/tree/base.rb', line 34
def generator
@generator ||= Types::Generator.new(context.registry)
end
|
29
30
31
|
# File 'lib/yoda/typing/tree/base.rb', line 29
def type
fail NotImplementedError
end
|