class I18nLinter::Rules::EnvironmentVariable

Constants

ENV_CONST

Public Instance Methods

check(tokens) click to toggle source
# File lib/i18n_linter/rules/environment_variable.rb, line 8
def check(tokens)
  reference_or_method(tokens) && I18nLinter::Digger.new(:@const).find([ENV_CONST], tokens[1])
end

Private Instance Methods

reference_or_method(tokens) click to toggle source
# File lib/i18n_linter/rules/environment_variable.rb, line 14
def reference_or_method(tokens)
  %i[aref method_add_arg].include?(tokens[0])
end