Class: Pubid::Iso::Transformer

Inherits:
Core::Transformer
  • Object
show all
Defined in:
lib/pubid/iso/transformer.rb

Class Method Summary collapse

Class Method Details

.convert_language(code) ⇒ Object



146
147
148
149
150
151
152
153
154
155
156
157
158
159
# File 'lib/pubid/iso/transformer.rb', line 146

def self.convert_language(code)
  case code
  when "R"
    "ru"
  when "F"
    "fr"
  when "E"
    "en"
  when "A"
    "ar"
  else
    code
  end
end

.convert_stage(code) ⇒ Object



122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
# File 'lib/pubid/iso/transformer.rb', line 122

def self.convert_stage(code)
  russian_code = Pubid::Iso::Renderer::Base::TRANSLATION[:russian][:stage].key(code.to_s)
  return { stage: russian_code } if russian_code

  case code
  when "NWIP"
    { stage: "NP" }
  when "D", "FPD"
    { stage: "DIS" }
  when "FD", "F"
    { stage: "FDIS" }
  when "Fpr"
    { stage: "PRF" }
  when "PDTR"
    { stage: "CD", type: "TR" }
  when "PDTS"
    { stage: "CD", type: "TS" }
  when "preCD"
    { stage: "PreCD" }
  else
    { stage: code }
  end
end