Class: Pubid::Iso::Renderer::Dir

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

Instance Method Summary collapse

Methods inherited from Base

#render, #render_amendments, #render_corrigendums, #render_edition, #render_iteration, #render_language, #render_short_stage, #render_stage, #render_type, #render_year

Instance Method Details

#render_dirtype(dirtype, _opts, _params) ⇒ Object



20
21
22
# File 'lib/pubid/iso/renderer/dir.rb', line 20

def render_dirtype(dirtype, _opts, _params)
  " #{dirtype}"
end

#render_identifier(params) ⇒ Object



4
5
6
7
8
9
10
11
12
13
14
# File 'lib/pubid/iso/renderer/dir.rb', line 4

def render_identifier(params)
  res = ("%{publisher}%{copublisher} DIR%{dirtype}%{number}%{year}%{supplement}%{language}" % params)

  if params.key?(:joint_document)
    joint_params = prerender_params(params[:joint_document].get_params, {})
    joint_params.default = ""
    res += (" + %{publisher}%{copublisher}%{dirtype}%{number}%{year}%{supplement}" % joint_params)
  end

  res
end

#render_number(number, _opts, _params) ⇒ Object



16
17
18
# File 'lib/pubid/iso/renderer/dir.rb', line 16

def render_number(number, _opts, _params)
  " #{number}"
end

#render_supplement(supplement, _opts, _params) ⇒ Object



24
25
26
27
28
29
30
31
# File 'lib/pubid/iso/renderer/dir.rb', line 24

def render_supplement(supplement, _opts, _params)
  if supplement.publisher && supplement.publisher != ""
    " #{supplement.publisher} SUP"
  else
    " SUP"
  end + (supplement.year && ":#{supplement.year}" || "") +
    (supplement.edition && " Edition #{supplement.edition}" || "")
end