Method: I18n::Inflector::API_Strict#has_kind?

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

#has_kind?(kind) ⇒ Boolean #has_kind?(kind, locale) ⇒ Boolean

Tests if a strict kind exists.

Overloads:

  • #has_kind?(kind) ⇒ Boolean

    Tests if a strict kind exists for the current locale.

    Parameters:

    • kind (Symbol)

      the identifier of a kind

    Returns:

    • (Boolean)

      true if the given kind exists, false otherwise

  • #has_kind?(kind, locale) ⇒ Boolean

    Tests if a strict kind exists for the given locale.

    Parameters:

    • kind (Symbol, String)

      the identifier of a kind

    • locale (Symbol)

      the locale identifier

    Returns:

    • (Boolean)

      true if the given kind exists, false otherwise

Returns:

  • (Boolean)

    true if the given kind exists, false otherwise

Raises:

[View source]

221
222
223
224
# File 'lib/i18n-inflector/api_strict.rb', line 221

def has_kind?(kind, locale=nil)
  return false if (kind.nil? || kind.to_s.empty?)
  data_safe(locale).has_kind?(kind.to_sym)
end