Class: RelatonBib::EditorialGroup
- Includes:
- RelatonBib
- Defined in:
- lib/relaton_bib/editorial_group.rb
Constant Summary
Constants included from RelatonBib
Instance Attribute Summary collapse
Instance Method Summary collapse
-
#initialize(technical_committee) ⇒ EditorialGroup
constructor
A new instance of EditorialGroup.
- #presence? ⇒ true
- #to_asciibib(prefix = "") ⇒ String
- #to_hash ⇒ Hash
- #to_xml(builder) ⇒ Object
Methods included from RelatonBib
Constructor Details
#initialize(technical_committee) ⇒ EditorialGroup
Returns a new instance of EditorialGroup.
11 12 13 |
# File 'lib/relaton_bib/editorial_group.rb', line 11 def initialize(technical_committee) @technical_committee = technical_committee end |
Instance Attribute Details
#technical_committee ⇒ Array<RelatonBib::TechnicalCommittee>
8 9 10 |
# File 'lib/relaton_bib/editorial_group.rb', line 8 def technical_committee @technical_committee end |
Instance Method Details
#presence? ⇒ true
37 38 39 |
# File 'lib/relaton_bib/editorial_group.rb', line 37 def presence? technical_committee.any? end |
#to_asciibib(prefix = "") ⇒ String
29 30 31 32 33 34 |
# File 'lib/relaton_bib/editorial_group.rb', line 29 def to_asciibib(prefix = "") pref = prefix.empty? ? "editorialgroup" : "#{prefix}.editorialgroup" technical_committee.map do |tc| tc.to_asciibib pref, technical_committee.size end.join end |
#to_hash ⇒ Hash
23 24 25 |
# File 'lib/relaton_bib/editorial_group.rb', line 23 def to_hash single_element_array technical_committee end |
#to_xml(builder) ⇒ Object
16 17 18 19 20 |
# File 'lib/relaton_bib/editorial_group.rb', line 16 def to_xml(builder) builder.editorialgroup do |b| technical_committee.each { |tc| tc.to_xml b } end end |