Class: Pubid::Iso::Renderer::Russian

Inherits:
Base
  • Object
show all
Defined in:
lib/pubid/iso/renderer/russian.rb

Constant Summary collapse

PUBLISHER =
{ "ISO" => "ИСО", "IEC" => "МЭК" }.freeze
STAGE =
{ "FDIS" => "ОПМС",
          "DIS" => "ПМС",
          "NP" => "НП",
          "AWI" => "АВИ",
          "CD" => "КПК",
          "PD" => "ПД",
          "FPD" => "ФПД",


}.freeze
TYPE =
{ "Guide" => "Руководство",
         "TS" => "ТС",
         "TR" => "ТО",
         "ISP" => "ИСП",
}.freeze

Instance Method Summary collapse

Methods inherited from Base

#render, #render_edition, #render_iteration, #render_language, #render_short_stage, #render_type, #render_year

Instance Method Details

#render_amendments(amendments, _opts, _params) ⇒ Object



57
58
59
# File 'lib/pubid/iso/renderer/russian.rb', line 57

def render_amendments(amendments, _opts, _params)
  super.gsub(" ", ".")
end

#render_copublisher(copublisher, _opts, _params) ⇒ Object



34
35
36
37
38
39
40
41
42
43
# File 'lib/pubid/iso/renderer/russian.rb', line 34

def render_copublisher(copublisher, _opts, _params)
  # ([email protected]_a?(Array) && [@copublisher]) || @copublisher
  if copublisher.is_a?(Array)
    copublisher.map(&:to_s).sort.map do |copublisher|
      "/#{PUBLISHER[copublisher].gsub('-', '/')}"
    end.join
  else
    "/#{PUBLISHER[copublisher]}"
  end
end

#render_corrigendums(corrigendums, _opts, _params) ⇒ Object



53
54
55
# File 'lib/pubid/iso/renderer/russian.rb', line 53

def render_corrigendums(corrigendums, _opts, _params)
  super.gsub(" ", ".")
end

#render_identifier(params) ⇒ Object



21
22
23
24
25
26
27
28
# File 'lib/pubid/iso/renderer/russian.rb', line 21

def render_identifier(params)
  if params[:type] == " Guide"
    params[:type] = ""
    "Руководство #{super(params)}"
  else
    super
  end
end

#render_publisher(publisher, _opts, _params) ⇒ Object



30
31
32
# File 'lib/pubid/iso/renderer/russian.rb', line 30

def render_publisher(publisher, _opts, _params)
  PUBLISHER[publisher]
end

#render_stage(stage, _opts, params) ⇒ Object



45
46
47
48
49
50
51
# File 'lib/pubid/iso/renderer/russian.rb', line 45

def render_stage(stage, _opts, params)
  if params[:copublisher]
    " #{STAGE[stage.abbr]}"
  else
    "/#{STAGE[stage.abbr]}"
  end
end