Method: I18n::Inflector::API_Strict#each_alias

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

#each_alias(kind) ⇒ LazyHashEnumerator #each_alias(kind, locale) ⇒ LazyHashEnumerator

Iterates through inflection aliases belonging to a strict kind and their pointers.

Overloads:

  • #each_alias(kind) ⇒ LazyHashEnumerator

    Iterates through inflection aliases (and their pointers) of the given kind and the current locale.

    Parameters:

    • kind (Symbol, String)

      the kind of aliases to get

    Returns:

  • #each_alias(kind, locale) ⇒ LazyHashEnumerator

    Iterates through inflection aliases (and their pointers) of the given kind and locale.

    Parameters:

    • kind (Symbol, String)

      the kind of aliases to get

    • locale (Symbol)

      the locale to use

    Returns:

Yields:

  • (alias, target)

    optional block in which each alias will be yielded

Yield Parameters:

  • alias (Symbol)

    an alias

  • target (Symbol)

    a name of the target token

Yield Returns:

Returns:

Raises:

[View source]

545
546
547
548
# File 'lib/i18n-inflector/api_strict.rb', line 545

def each_alias(kind=nil, locale=nil, &block)
  kind = kind.to_s.empty? ? nil : kind.to_sym
  data_safe(locale).each_alias(kind, &block)
end