Class: Relaton::Render::Jis::General
- Inherits:
-
Iso::General
- Object
- Iso::General
- Relaton::Render::Jis::General
- Defined in:
- lib/relaton/render-jis/general.rb
Instance Method Summary collapse
- #config_loc ⇒ Object
- #klass_initialize(_options) ⇒ Object
- #render1(doc) ⇒ Object
- #render_all(bib, type: "author-date") ⇒ Object
Instance Method Details
#config_loc ⇒ Object
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() 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 |