Sha256: bc691ed393ee6a9794ca1514a4ab6532f4331bb8d2ab11b24d3186dc747cae8e

Contents?: true

Size: 732 Bytes

Versions: 5

Compression:

Stored size: 732 Bytes

Contents

class Fab

  LANGUAGE_CODE_ISO6391_LIST = [
    'en',  # English
    'fr',  # French
    'de',  # German
    'ja',  # Japanese
  ]

  attr_accessor :language_code_iso6391_list

  # Fab a language code e.g. "en" for English.
  # Delegates to #language_code_iso6391
  #
  # @returns [String] a random language code
  #
  def language_code(options = {})
    language_code_iso6391(options)
  end

  # Fab a language code e.g. "en" for English.
  # Samples from LANGUAGE_CODE_ISO6391_LIST.
  #
  # @returns [String] a random language code
  #
  def language_code_iso6391(options = {})
    LANGUAGE_CODE_ISO6391_LIST.sample
  end

  def language_code_iso6391_list
    @language_code_iso6391_list ||= LANGUAGE_CODE_ISO6391_LIST
  end

end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
sixarm_ruby_fab-1.1.0 lib/sixarm_ruby_fab/locale.rb
sixarm_ruby_fab-1.0.4 lib/sixarm_ruby_fab/locale.rb
sixarm_ruby_fab-1.0.2 lib/sixarm_ruby_fab/locale.rb
sixarm_ruby_fab-1.0.1 lib/sixarm_ruby_fab/locale.rb
sixarm_ruby_fab-1.0.0 lib/sixarm_ruby_fab/locale.rb