diff options
author | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2018-02-23 12:01:27 +0300 |
---|---|---|
committer | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2018-02-23 12:01:27 +0300 |
commit | 8517627410499486e2bb09d8a55ba6f0088d7503 (patch) | |
tree | 60a4d9857b9de8a02f57bf359d4a2593c0efedb9 /lib/gitlab/ci/pipeline/expression/lexeme/equals.rb | |
parent | 5ee43097fde03ac2fabb655f14aa15c8fe8ed631 (diff) |
Move pipeline expression lexemes to a separate module
Diffstat (limited to 'lib/gitlab/ci/pipeline/expression/lexeme/equals.rb')
-rw-r--r-- | lib/gitlab/ci/pipeline/expression/lexeme/equals.rb | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/lib/gitlab/ci/pipeline/expression/lexeme/equals.rb b/lib/gitlab/ci/pipeline/expression/lexeme/equals.rb new file mode 100644 index 00000000000..0cb21131d69 --- /dev/null +++ b/lib/gitlab/ci/pipeline/expression/lexeme/equals.rb @@ -0,0 +1,27 @@ +module Gitlab + module Ci + module Pipeline + module Expression + module Lexeme + class Equals < Lexeme::Base + PATTERN = /==/.freeze + TYPE = :operator + + def initialize(left, right) + @left = left + @right = right + end + + def evaluate(**variables) + @left.evaluate(variables) == @right.evaluate(variables) + end + + def self.build(_value, behind, ahead) + new(behind, ahead) + end + end + end + end + end + end +end |