class DrgDSL::Ast::Expression
Represents a list of expressions joined with an “OR”, e.g., “exp1 or exp2 or exp3 …”
Attributes
expressions[R]
Public Class Methods
new(expressions)
click to toggle source
# File lib/drgdsl/ast.rb, line 82 def initialize(expressions) @expressions = expressions end
Public Instance Methods
hash()
click to toggle source
# File lib/drgdsl/ast.rb, line 102 def hash @hash ||= [type, *expressions].hash end
only_mdc_equality_nodes?()
click to toggle source
@return [Boolean] whether this expression only contains MDC equality
checks.
# File lib/drgdsl/ast.rb, line 94 def only_mdc_equality_nodes? expressions.all?(&:mdc_equality?) end
only_sep_equality_nodes?()
click to toggle source
@return [Boolean] whether this expression only contains SEP equality
checks.
# File lib/drgdsl/ast.rb, line 88 def only_sep_equality_nodes? expressions.all?(&:sep_equality?) end
to_hash()
click to toggle source
# File lib/drgdsl/ast.rb, line 98 def to_hash { or: [expressions.map(&:to_hash)] } end