class SiSU_i18n::Alphabet

Public Class Methods

new(lng_code) click to toggle source
# File lib/sisu/i18n.rb, line 195
def initialize(lng_code)
  @lng_code=lng_code
end

Public Instance Methods

hash_arrays() click to toggle source
# File lib/sisu/i18n.rb, line 198
def hash_arrays
  @alph=case @lng_code
  when /en/                                                              #english
    {
      u: %w[A B C D E F G H I J K L M N O P Q R S T U V W X Y Z],
      l: %w[a b c d e f g h i j k l m n o p q r s t u v w x y z]
    }
  when /da|no|nn/                                                        #danish, norwegian
    {
      u: %w[A B C D E F G H I J K L M N O P Q R S T U V W X Y Z Å Æ Ø],
      l: %w[a b c d e f g h i j k l m n o p q r s t u v w x y z å æ ø]
      #u: %W[A B C D E F G H I J K L M N O P Q R S T U V W X Y Z Æ Ø Å],
      #l: %w[a b c d e f g h i j k l m n o p q r s t u v w x y z æ ø å]
    }
  when /sv/                                                              #swedish
    {
      u: %w[A B C D E F G H I J K L M N O P Q R S T U V W X Y Z Å Ä Ö],
      l: %w[a b c d e f g h i j k l m n o p q r s t u v w x y z å ä ö]
    }
  else                                                                   #english default
    {
      u: %w[A B C D E F G H I J K L M N O P Q R S T U V W X Y Z],
      l: %w[a b c d e f g h i j k l m n o p q r s t u v w x y z]
    }
  end
end
hash_strings() click to toggle source
# File lib/sisu/i18n.rb, line 224
def hash_strings
  { u: hash_arrays[:u].join, l: hash_arrays[:l].join }
end