Class: Quby::Compiler::Entities::SexpVariable
- Inherits:
-
Object
- Object
- Quby::Compiler::Entities::SexpVariable
- Defined in:
- lib/quby/compiler/entities/sexp_variable.rb
Instance Attribute Summary collapse
-
#calculation ⇒ Object
readonly
Returns the value of attribute calculation.
-
#key ⇒ Object
readonly
Returns the value of attribute key.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Instance Method Summary collapse
-
#initialize(key:, calculation:, type:) ⇒ SexpVariable
constructor
A new instance of SexpVariable.
-
#validate(questionnaire, calculation: self.calculation) ⇒ Object
Called by DefinitionValidator.
Constructor Details
#initialize(key:, calculation:, type:) ⇒ SexpVariable
Returns a new instance of SexpVariable.
7 8 9 10 11 |
# File 'lib/quby/compiler/entities/sexp_variable.rb', line 7 def initialize(key:, calculation:, type:) @key = key @type = type @calculation = calculation end |
Instance Attribute Details
#calculation ⇒ Object (readonly)
Returns the value of attribute calculation.
5 6 7 |
# File 'lib/quby/compiler/entities/sexp_variable.rb', line 5 def calculation @calculation end |
#key ⇒ Object (readonly)
Returns the value of attribute key.
5 6 7 |
# File 'lib/quby/compiler/entities/sexp_variable.rb', line 5 def key @key end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
5 6 7 |
# File 'lib/quby/compiler/entities/sexp_variable.rb', line 5 def type @type end |
Instance Method Details
#validate(questionnaire, calculation: self.calculation) ⇒ Object
Called by DefinitionValidator.
14 15 16 |
# File 'lib/quby/compiler/entities/sexp_variable.rb', line 14 def validate(questionnaire, calculation: self.calculation) validate_node(calculation, questionnaire:, type:) end |