Class: RelatonIsoBib::EditorialGroup
- Inherits:
-
Object
- Object
- RelatonIsoBib::EditorialGroup
- Defined in:
- lib/relaton_iso_bib/editorial_group.rb
Overview
ISO project group.
Instance Attribute Summary collapse
- #secretariat ⇒ String readonly
- #subcommittee ⇒ RelatonIsoBib::IsoSubgroup readonly
- #technical_committee ⇒ Array<RelatonIsoBib::IsoSubgroup> readonly
- #workgroup ⇒ RelatonIsoBib::IsoSubgroup readonly
Instance Method Summary collapse
-
#initialize(technical_committee:, **args) ⇒ EditorialGroup
constructor
A new instance of EditorialGroup.
- #to_xml(builder) ⇒ Object
Constructor Details
#initialize(technical_committee:, **args) ⇒ EditorialGroup
Returns a new instance of EditorialGroup.
34 35 36 37 38 39 40 41 42 43 44 45 |
# File 'lib/relaton_iso_bib/editorial_group.rb', line 34 def initialize(technical_committee:, **args) @technical_committee = technical_committee.map do |tc| tc.is_a?(Hash) ? IsoSubgroup.new(tc) : tc end @subcommittee = args.fetch(:subcommittee, []).map do |sc| sc.is_a?(Hash) ? IsoSubgroup.new(sc) : sc end @workgroup = args.fetch(:workgroup, []).map do |wg| wg.is_a?(Hash) ? IsoSubgroup.new(wg) : wg end @secretariat = args[:secretariat] end |
Instance Attribute Details
#secretariat ⇒ String (readonly)
16 17 18 |
# File 'lib/relaton_iso_bib/editorial_group.rb', line 16 def secretariat @secretariat end |
#subcommittee ⇒ RelatonIsoBib::IsoSubgroup (readonly)
10 11 12 |
# File 'lib/relaton_iso_bib/editorial_group.rb', line 10 def subcommittee @subcommittee end |
#technical_committee ⇒ Array<RelatonIsoBib::IsoSubgroup> (readonly)
7 8 9 |
# File 'lib/relaton_iso_bib/editorial_group.rb', line 7 def technical_committee @technical_committee end |
#workgroup ⇒ RelatonIsoBib::IsoSubgroup (readonly)
13 14 15 |
# File 'lib/relaton_iso_bib/editorial_group.rb', line 13 def workgroup @workgroup end |
Instance Method Details
#to_xml(builder) ⇒ Object
50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 |
# File 'lib/relaton_iso_bib/editorial_group.rb', line 50 def to_xml(builder) return unless technical_committee || subcommittee || workgroup || secretariat builder.editorialgroup do technical_committee.each do |tc| builder.technical_committee { tc.to_xml builder } end subcommittee.each do |sc| builder.subcommittee { sc.to_xml builder } end workgroup.each do |wg| builder.workgroup { wg.to_xml builder } end builder.secretariat secretariat if secretariat end end |