Sha256: 7a0800c68d8867c67cef6437bd527d4984a2be2c3ec210d22044f8cc7f58b1a4
Contents?: true
Size: 1.29 KB
Versions: 38
Compression:
Stored size: 1.29 KB
Contents
module RelatonBipm class EditorialGroup include RelatonBib # @return [Array<RelatonBipm::Committee>] attr_reader :committee # @return [Array<RelatonBipm::WorkGroup>] attr_reader :workgroup # @param committee [Array<RelatonBipm::Committee>] # @param workgroup [Array<RelatonBipm::WorkGroup>] def initialize(committee:, workgroup: []) @committee = committee @workgroup = workgroup end # @param builder [Nokogiri::XML::Builder] def to_xml(builder) builder.editorialgroup do |b| committee.each { |c| c.to_xml b } workgroup.each { |c| c.to_xml b } end end # @param prefix [String] # @return [String] def to_asciibib(prefix = "") # rubocop:disable Metrics/AbcSize pref = prefix.empty? ? prefix : "#{prefix}." pref += "editorialgroup" out = "" committee.each { |c| out += c.to_asciibib pref, committee.size } workgroup.each { |w| out += w.to_asciibib pref, workgroup.size } out end # @return [Hash] def to_hash hash = {} hash["committee"] = single_element_array(committee) if committee.any? hash["workgroup"] = single_element_array(workgroup) if workgroup.any? hash end # @return [true] def presence? true end end end
Version data entries
38 entries across 38 versions & 1 rubygems