Class: Pubid::Bsi::Renderer::Base

Inherits:
Core::Renderer::Base
  • Object
show all
Defined in:
lib/pubid/bsi/renderer/base.rb

Constant Summary collapse

TYPE =
"".freeze

Instance Method Summary collapse

Instance Method Details

#render_edition(edition, _opts, _params) ⇒ Object



16
17
18
# File 'lib/pubid/bsi/renderer/base.rb', line 16

def render_edition(edition, _opts, _params)
  " v#{edition}"
end

#render_identifier(params) ⇒ Object



5
6
7
8
9
10
# File 'lib/pubid/bsi/renderer/base.rb', line 5

def render_identifier(params)
  suffix = "%{supplement}%{tracked_changes}%{translation}%{pdf}" % params
  return "%{publisher} %{adopted}#{suffix}" % params unless params[:adopted].to_s.empty?

  "%{publisher} %{number}%{part}%{edition}%{year}%{month}#{suffix}" % params
end

#render_month(month, _opts, _params) ⇒ Object



12
13
14
# File 'lib/pubid/bsi/renderer/base.rb', line 12

def render_month(month, _opts, _params)
  "-#{month}"
end

#render_pdf(pdf, _opts, _params) ⇒ Object



32
33
34
# File 'lib/pubid/bsi/renderer/base.rb', line 32

def render_pdf(pdf, _opts, _params)
  " PDF" if pdf
end

#render_supplement(supplement, _opts, _params) ⇒ Object



20
21
22
# File 'lib/pubid/bsi/renderer/base.rb', line 20

def render_supplement(supplement, _opts, _params)
  supplement.to_s
end

#render_tracked_changes(tracked_changes, _opts, _params) ⇒ Object



24
25
26
# File 'lib/pubid/bsi/renderer/base.rb', line 24

def render_tracked_changes(tracked_changes, _opts, _params)
  " - TC" if tracked_changes
end

#render_translation(translation, _opts, _params) ⇒ Object



28
29
30
# File 'lib/pubid/bsi/renderer/base.rb', line 28

def render_translation(translation, _opts, _params)
  " (#{translation})"
end