Class: Yoda::Typing::Traces::Normal
- Defined in:
- lib/yoda/typing/traces/normal.rb
Overview
Store evaluation result for each ast node.
Instance Attribute Summary collapse
-
#context ⇒ Object
readonly
Returns the value of attribute context.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Instance Method Summary collapse
-
#initialize(context, type) ⇒ Normal
constructor
A new instance of Normal.
- #values ⇒ Object
Constructor Details
#initialize(context, type) ⇒ Normal
Returns a new instance of Normal.
10 11 12 13 14 |
# File 'lib/yoda/typing/traces/normal.rb', line 10 def initialize(context, type) fail ArgumentError, type unless type.is_a?(Model::TypeExpressions::Base) @context = context @type = type end |
Instance Attribute Details
#context ⇒ Object (readonly)
Returns the value of attribute context.
6 7 8 |
# File 'lib/yoda/typing/traces/normal.rb', line 6 def context @context end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
6 7 8 |
# File 'lib/yoda/typing/traces/normal.rb', line 6 def type @type end |
Instance Method Details
#values ⇒ Object
16 17 18 |
# File 'lib/yoda/typing/traces/normal.rb', line 16 def values type.resolve(context.registry) end |