Class: Pubid::Iso::Renderer::Tc

Inherits:
Base
  • Object
show all
Defined in:
lib/pubid/iso/renderer/tc.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_identifier(params) ⇒ Object



4
5
6
# File 'lib/pubid/iso/renderer/tc.rb', line 4

def render_identifier(params)
  "%{publisher}%{copublisher} %{tctype} %{tcnumber}%{sctype}%{wgtype} N%{number}" % params
end

#render_sctype(sctype, _opts, params) ⇒ Object

TC 184/SC/WG 4 - no wg number TC 184/SC 4/WG 12 - separate sc and wg number



14
15
16
17
18
19
20
# File 'lib/pubid/iso/renderer/tc.rb', line 14

def render_sctype(sctype, _opts, params)
  if params[:wgnumber] || !params[:wgtype]
    "/#{sctype} #{params[:scnumber]}"
  else
    "/#{sctype}"
  end
end

#render_tctype(tctype, _opts, _params) ⇒ Object



8
9
10
# File 'lib/pubid/iso/renderer/tc.rb', line 8

def render_tctype(tctype, _opts, _params)
  tctype.is_a?(Array) && tctype.join("/") || tctype.to_s
end

#render_wgtype(wgtype, _opts, params) ⇒ Object



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

def render_wgtype(wgtype, _opts, params)
  if params[:wgnumber]
    "/#{wgtype} #{params[:wgnumber]}"
  else
    "/#{wgtype} #{params[:scnumber]}"
  end
end