Class: RelatonBib::BiblioNoteCollection
- Extended by:
- Forwardable
- Defined in:
- lib/relaton_bib/biblio_note.rb
Instance Method Summary collapse
- #<<(bibnote) ⇒ self
-
#initialize(notes) ⇒ BiblioNoteCollection
constructor
A new instance of BiblioNoteCollection.
- #to_xml(**opts) ⇒ Object
Constructor Details
#initialize(notes) ⇒ BiblioNoteCollection
Returns a new instance of BiblioNoteCollection.
8 9 10 |
# File 'lib/relaton_bib/biblio_note.rb', line 8 def initialize(notes) @array = notes end |
Instance Method Details
#<<(bibnote) ⇒ self
14 15 16 17 |
# File 'lib/relaton_bib/biblio_note.rb', line 14 def <<(bibnote) @array << bibnote self end |
#to_xml(**opts) ⇒ Object
22 23 24 25 26 |
# File 'lib/relaton_bib/biblio_note.rb', line 22 def to_xml(**opts) bnc = @array.select { |bn| bn.language&.include? opts[:lang] } bnc = @array unless bnc.any? bnc.each { |bn| bn.to_xml opts[:builder] } end |