Module: Equation::BooleanAnd2

Defined in:
lib/equation_grammar.rb

Instance Method Summary collapse

Instance Method Details

#value(ctx:) ⇒ Object



234
235
236
237
238
239
240
241
242
243
244
# File 'lib/equation_grammar.rb', line 234

def value(ctx:)
  base = lhs.value(ctx: ctx)
  tail.elements.each do |k|
    case k.operator.text_value
      when '&&'
        base &&= k.rhs.value(ctx: ctx)
    end
  end

  base
end