From 4684478e94f92726bbd90b099b3c2f5321d1a7d4 Mon Sep 17 00:00:00 2001 From: Ashwin Maroli Date: Mon, 29 Apr 2019 23:45:45 +0530 Subject: [PATCH] Use a private constant to stash token-types --- lib/liquid/parser.rb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/liquid/parser.rb b/lib/liquid/parser.rb index 69543434..152e04cd 100644 --- a/lib/liquid/parser.rb +++ b/lib/liquid/parser.rb @@ -44,11 +44,14 @@ module Liquid tok[0] == type end + CONSUME_TOKENS = [:string, :number] + private_constant :CONSUME_TOKENS + def expression token = @tokens[@p] if token[0] == :id variable_signature - elsif [:string, :number].include? token[0] + elsif CONSUME_TOKENS.include? token[0] consume elsif token.first == :open_round consume