Module: Equation::Logical2

Defined in:
lib/equation_grammar.rb

Instance Method Summary collapse

Instance Method Details

#value(ctx:) ⇒ Object



92
93
94
95
96
97
98
99
100
101
102
# File 'lib/equation_grammar.rb', line 92

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