Method: I18n::Inflector::API_Strict#has_true_token?

Defined in:
lib/i18n-inflector/api_strict.rb

#has_true_token?(token, kind) ⇒ Boolean #has_true_token?(token, kind, locale) ⇒ Boolean Also known as: token_is_true?

Checks if the given token belonging to a strict kind is a true token (not alias).

Overloads:

  • #has_true_token?(token, kind) ⇒ Boolean

    Uses the current locale and the given kind to check if the given token is a true token.

    Parameters:

    • token (Symbol, String)

      name of the checked token

    • kind (Symbol, String)

      the kind of the given token

    Returns:

    • (Boolean)

      true if the given token is a true token, false otherwise

  • #has_true_token?(token, kind, locale) ⇒ Boolean

    Uses the given locale and kind to check if the given token is a true token.

    Parameters:

    • token (Symbol, String)

      name of the checked token

    • kind (Symbol, String)

      the kind of the given token

    • locale (Symbol)

      the locale to use

    Returns:

    • (Boolean)

      true if the given token is a true token, false otherwise

Returns:

  • (Boolean)

    true if the given token is a true token, false otherwise

Raises:


288
289
290
291
292
# File 'lib/i18n-inflector/api_strict.rb', line 288

def has_true_token?(*args)
  token, kind, locale = tkl_args(args)
  return false if (token.nil? || kind.nil?)
  data_safe(locale).has_true_token?(token, kind)
end