Class: Algolia::Recommend::SupportedLanguage

Inherits:
Object
  • Object
show all
Defined in:
lib/algolia/models/recommend/supported_language.rb

Constant Summary collapse

AF =
"af".freeze
AR =
"ar".freeze
AZ =
"az".freeze
BG =
"bg".freeze
BN =
"bn".freeze
CA =
"ca".freeze
CS =
"cs".freeze
CY =
"cy".freeze
DA =
"da".freeze
DE =
"de".freeze
EL =
"el".freeze
EN =
"en".freeze
EO =
"eo".freeze
ES =
"es".freeze
ET =
"et".freeze
EU =
"eu".freeze
FA =
"fa".freeze
FI =
"fi".freeze
FO =
"fo".freeze
FR =
"fr".freeze
GA =
"ga".freeze
GL =
"gl".freeze
HE =
"he".freeze
HI =
"hi".freeze
HU =
"hu".freeze
HY =
"hy".freeze
ID =
"id".freeze
IS =
"is".freeze
IT =
"it".freeze
JA =
"ja".freeze
KA =
"ka".freeze
KK =
"kk".freeze
KO =
"ko".freeze
KU =
"ku".freeze
KY =
"ky".freeze
LT =
"lt".freeze
LV =
"lv".freeze
MI =
"mi".freeze
MN =
"mn".freeze
MR =
"mr".freeze
MS =
"ms".freeze
MT =
"mt".freeze
NB =
"nb".freeze
NL =
"nl".freeze
NO =
"no".freeze
NS =
"ns".freeze
PL =
"pl".freeze
PS =
"ps".freeze
PT =
"pt".freeze
PT_BR =
"pt-br".freeze
QU =
"qu".freeze
RO =
"ro".freeze
RU =
"ru".freeze
SK =
"sk".freeze
SQ =
"sq".freeze
SV =
"sv".freeze
SW =
"sw".freeze
TA =
"ta".freeze
TE =
"te".freeze
TH =
"th".freeze
TL =
"tl".freeze
TN =
"tn".freeze
TR =
"tr".freeze
TT =
"tt".freeze
UK =
"uk".freeze
UR =
"ur".freeze
UZ =
"uz".freeze
ZH =
"zh".freeze

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.all_varsObject



78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
# File 'lib/algolia/models/recommend/supported_language.rb', line 78

def self.all_vars
  @all_vars ||= [
    AF,
    AR,
    AZ,
    BG,
    BN,
    CA,
    CS,
    CY,
    DA,
    DE,
    EL,
    EN,
    EO,
    ES,
    ET,
    EU,
    FA,
    FI,
    FO,
    FR,
    GA,
    GL,
    HE,
    HI,
    HU,
    HY,
    ID,
    IS,
    IT,
    JA,
    KA,
    KK,
    KO,
    KU,
    KY,
    LT,
    LV,
    MI,
    MN,
    MR,
    MS,
    MT,
    NB,
    NL,
    NO,
    NS,
    PL,
    PS,
    PT,
    PT_BR,
    QU,
    RO,
    RU,
    SK,
    SQ,
    SV,
    SW,
    TA,
    TE,
    TH,
    TL,
    TN,
    TR,
    TT,
    UK,
    UR,
    UZ,
    ZH
  ].freeze
end

.build_from_hash(value) ⇒ String

Builds the enum from string

Parameters:

  • The (String)

    enum value in the form of the string

Returns:

  • (String)

    The enum value



154
155
156
# File 'lib/algolia/models/recommend/supported_language.rb', line 154

def self.build_from_hash(value)
  new.build_from_hash(value)
end

Instance Method Details

#build_from_hash(value) ⇒ String

Builds the enum from string

Parameters:

  • The (String)

    enum value in the form of the string

Returns:

  • (String)

    The enum value



161
162
163
164
# File 'lib/algolia/models/recommend/supported_language.rb', line 161

def build_from_hash(value)
  return value if SupportedLanguage.all_vars.include?(value)
  raise "Invalid ENUM value #{value} for class #SupportedLanguage"
end