class I18nLinter::Rules::Underscore

Public Instance Methods

check(tokens) click to toggle source
# File lib/i18n_linter/rules/underscore.rb, line 6
def check(tokens)
  tokens[0] == :string_content && underscore?(tokens)
end

Private Instance Methods

underscore?(tokens) click to toggle source
# File lib/i18n_linter/rules/underscore.rb, line 12
def underscore?(tokens)
  string_tokens = tokens[1]
  return false unless string_tokens

  string_tokens[0] == :@tstring_content && /\_/ =~ string_tokens[1]
end