Class: Pubid::Iso::Renderer::UrnDir
- Inherits:
-
Urn
- Object
- Core::Renderer::Urn
- Urn
- Pubid::Iso::Renderer::UrnDir
show all
- Defined in:
- lib/pubid/iso/renderer/urn-dir.rb
Constant Summary
Constants inherited
from Urn
Pubid::Iso::Renderer::Urn::STAGES
Instance Method Summary
collapse
Methods inherited from Urn
#render_stage
Instance Method Details
#render_dirtype(dirtype, _opts, _params) ⇒ Object
20
21
22
|
# File 'lib/pubid/iso/renderer/urn-dir.rb', line 20
def render_dirtype(dirtype, _opts, _params)
":#{dirtype.downcase}"
end
|
#render_identifier(params) ⇒ Object
4
5
6
7
8
9
10
11
12
13
14
|
# File 'lib/pubid/iso/renderer/urn-dir.rb', line 4
def render_identifier(params)
res = ("urn:iso:doc:%{publisher}%{copublisher}: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}%{copublisher}%{dirtype}%{number}%{supplement}" % joint_params)
end
res
end
|
#render_number(number, _opts, _params) ⇒ Object
16
17
18
|
# File 'lib/pubid/iso/renderer/urn-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/urn-dir.rb', line 24
def render_supplement(supplement, _opts, _params)
if supplement.publisher && supplement.publisher != ""
":sup:#{supplement.publisher.downcase}"
else
":sup"
end + (supplement.year && ":#{supplement.year}" || "") +
(supplement.edition && ":ed-#{supplement.edition}" || "")
end
|