Class: Ikra::TypeInference::SymbolTable::Variable
- Defined in:
- lib/types/inference/symbol_table.rb
Overview
Represents a lexical or local variable. Variables have a type and can read and/or written, all of which is stored in this class.
Instance Attribute Summary collapse
-
#kind ⇒ Object
readonly
Determines the kind of the variables: lexial or local.
-
#read ⇒ Object
Returns the value of attribute read.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
-
#written ⇒ Object
Returns the value of attribute written.
Instance Method Summary collapse
-
#initialize(type: Types::UnionType.new, kind: :local) ⇒ Variable
constructor
A new instance of Variable.
Constructor Details
Instance Attribute Details
#kind ⇒ Object (readonly)
Determines the kind of the variables: lexial or local
18 19 20 |
# File 'lib/types/inference/symbol_table.rb', line 18 def kind @kind end |
#read ⇒ Object
Returns the value of attribute read.
20 21 22 |
# File 'lib/types/inference/symbol_table.rb', line 20 def read @read end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
15 16 17 |
# File 'lib/types/inference/symbol_table.rb', line 15 def type @type end |
#written ⇒ Object
Returns the value of attribute written.
21 22 23 |
# File 'lib/types/inference/symbol_table.rb', line 21 def written @written end |