2018-10-26 00:12:43 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2018-02-23 04:01:27 -05:00
|
|
|
module Gitlab
|
|
|
|
module Ci
|
|
|
|
module Pipeline
|
|
|
|
module Expression
|
|
|
|
module Lexeme
|
2018-02-23 04:13:43 -05:00
|
|
|
class Equals < Lexeme::Operator
|
2018-02-23 04:01:27 -05:00
|
|
|
PATTERN = /==/.freeze
|
|
|
|
|
|
|
|
def initialize(left, right)
|
|
|
|
@left = left
|
|
|
|
@right = right
|
|
|
|
end
|
|
|
|
|
2018-02-27 06:36:30 -05:00
|
|
|
def evaluate(variables = {})
|
2018-02-23 04:01:27 -05:00
|
|
|
@left.evaluate(variables) == @right.evaluate(variables)
|
|
|
|
end
|
|
|
|
|
|
|
|
def self.build(_value, behind, ahead)
|
|
|
|
new(behind, ahead)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|