Class: Pubid::Iec::Renderer::WorkingDocumentUrn

Inherits:
Urn
  • Object
show all
Defined in:
lib/pubid/iec/renderer/working_document_urn.rb

Constant Summary

Constants inherited from Urn

Urn::STAGES

Instance Method Summary collapse

Methods inherited from Urn

#render_amendments, #render_conjuction_part, #render_copublisher, #render_corrigendums, #render_fragment, #render_language, #render_number, #render_part, #render_part_version, #render_type, #render_vap, #render_version

Instance Method Details

#render(with_date: true, with_language_code: :iso, annotated: false, **args) ⇒ Object



16
17
18
19
20
# File 'lib/pubid/iec/renderer/working_document_urn.rb', line 16

def render(with_date: true, with_language_code: :iso, annotated: false, **args)
  render_base_identifier(**args.merge(
    with_date: with_date, with_language_code: with_language_code, annotated: annotated,
  )) + @prerendered_params[:language].to_s
end

#render_identifier(params) ⇒ Object



4
5
6
# File 'lib/pubid/iec/renderer/working_document_urn.rb', line 4

def render_identifier(params)
  "urn:iec:working-document:%{technical_committee}:%{number}%{stage}" % params
end

#render_stage(stage, _opts, _params) ⇒ Object



12
13
14
# File 'lib/pubid/iec/renderer/working_document_urn.rb', line 12

def render_stage(stage, _opts, _params)
  ":stage-#{stage.to_s.downcase}"
end

#render_technical_committee(technical_committee, _opts, _params) ⇒ Object



8
9
10
# File 'lib/pubid/iec/renderer/working_document_urn.rb', line 8

def render_technical_committee(technical_committee, _opts, _params)
  technical_committee.to_s.gsub("/", "-").downcase
end