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

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

Constant Summary

Constants inherited from Base

Base::TRANSLATION, Base::TYPE

Instance Attribute Summary

Attributes inherited from Base

#prerendered_params

Instance Method Summary collapse

Methods inherited from Base

#omit_post_publisher_symbol?, #render, #render_addendum, #render_base, #render_base_identifier, #render_copublisher_string, #render_edition, #render_iteration, #render_language, #render_part, #render_publisher, #render_stage, #render_type_prefix, #render_typed_stage, #render_year

Instance Method Details

#render_dirtype(dirtype, _opts, _params) ⇒ Object



22
23
24
# File 'lib/pubid/iso/renderer/dir.rb', line 22

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

#render_identifier(params, opts) ⇒ Object



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

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

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

  res
end

#render_number(number, _opts, _params) ⇒ Object



18
19
20
# File 'lib/pubid/iso/renderer/dir.rb', line 18

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

#render_supplement(supplement, _opts, _params) ⇒ Object



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

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