class DrgDSL::Ast::BasicExpression
A BasicExpression
consists of a variable and a condition (because every variant of condition has a variable)
Attributes
condition[R]
variable[R]
Public Class Methods
new(variable:, condition:)
click to toggle source
@param variable [Variable] @param condition [Comparison|UnaryCondition|TableCondition|Empty]
# File lib/drgdsl/ast.rb, line 217 def initialize(variable:, condition:) @variable = variable @condition = condition end
Public Instance Methods
hash()
click to toggle source
# File lib/drgdsl/ast.rb, line 234 def hash @hash ||= [type, variable, condition].hash end
mdc_equality?()
click to toggle source
# File lib/drgdsl/ast.rb, line 222 def mdc_equality? variable.name == "MDC" && condition.op == "=" end
sep_equality?()
click to toggle source
# File lib/drgdsl/ast.rb, line 226 def sep_equality? variable.name == "SEP" && condition.op == "=" end
to_hash()
click to toggle source
# File lib/drgdsl/ast.rb, line 230 def to_hash { basic: { var: variable.to_hash, condition: condition.to_hash } } end