Class: Relaton::Render::Jis::General

Inherits:
Iso::General
  • Object
show all
Defined in:
lib/relaton/render-jis/general.rb

Instance Method Summary collapse

Instance Method Details

#config_locObject



10
11
12
# File 'lib/relaton/render-jis/general.rb', line 10

def config_loc
  YAML.load_file(File.join(File.dirname(__FILE__), "config.yml"))
end

#klass_initialize(_options) ⇒ Object



14
15
16
17
# File 'lib/relaton/render-jis/general.rb', line 14

def klass_initialize(_options)
  super
  @parseklass = Relaton::Render::Jis::Parse
end

#render1(doc) ⇒ Object



19
20
21
22
23
24
# File 'lib/relaton/render-jis/general.rb', line 19

def render1(doc)
  r = doc.relation.select { |x| x.type == "hasRepresentation" }
    .map { |x| @i18n.also_pub_as + render_single_bibitem(x.bibitem) }
  out = [render_single_bibitem(doc)] + r
  @i18n.l10n(out.join(". ").gsub(".. ", ". ").sub(/\.\s*$/, ""))
end

#render_all(bib, type: "author-date") ⇒ Object



26
27
28
29
30
# File 'lib/relaton/render-jis/general.rb', line 26

def render_all(bib, type: "author-date")
  ret = super
  ret&.each_value { |k| k[:formattedref]&.sub!(/[.。]\s*$/, "") }
  ret
end