Class: Quby::Compiler::Entities::SexpVariable

Inherits:
Object
  • Object
show all
Defined in:
lib/quby/compiler/entities/sexp_variable.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#calculationObject (readonly)

Returns the value of attribute calculation.



5
6
7
# File 'lib/quby/compiler/entities/sexp_variable.rb', line 5

def calculation
  @calculation
end

#keyObject (readonly)

Returns the value of attribute key.



5
6
7
# File 'lib/quby/compiler/entities/sexp_variable.rb', line 5

def key
  @key
end

#typeObject (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