Method: I18n::Inflector::API_Strict#has_alias?

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

#has_alias?(token, kind) ⇒ Boolean #has_alias?(token, kind, locale) ⇒ Boolean Also known as: token_is_alias?

Checks if the given token belonging to a strict kind is an alias.

Overloads:

  • #has_alias?(token, kind) ⇒ Boolean

    Uses the current locale and the given kind to check if the given token is an alias.

    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 an alias, false otherwise

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

    Uses the given locale and kind to check if the given token is an alias.

    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 an alias, false otherwise

Returns:

  • (Boolean)

    true if the given token is an alias, false otherwise

Raises:

[View source]

264
265
266
267
268
# File 'lib/i18n-inflector/api_strict.rb', line 264

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