Sha256: c4d5ae39ae9dcf695e5f21b0129cea804d45394053bdbf1c8290d4c0dd0b716d
Contents?: true
Size: 1.2 KB
Versions: 16
Compression:
Stored size: 1.2 KB
Contents
module RelatonIeee class BallotingGroup TYPES = %w[individual entity].freeze # @return [String] attr_reader :type, :content # # Initialize balloting group # # @param [String] type type # @param [String] content content # def initialize(type:, content:) unless TYPES.include?(type) warn "[relaton-ieee] WARNING: type of Balloting group must be one of #{TYPES.join(', ')}" end @type = type @content = content end # # Render balloting group to XML # # @param [Nokogiri::XML::Builder] builder XML builder # def to_xml(builder) builder.send :"balloting-group", content, type: type end # # Render balloting group to Hash # # @return [Hash] balloting group as Hash # def to_hash { "type" => type, "content" => content } end # # Render balloting group to AsciiBib # # @param [String] prefix Prefix # # @return [String] AsciiBib # def to_asciibib(prefix = "") pref = prefix.empty? ? prefix : "#{prefix}." pref += "balloting-group" out = "#{pref}.type:: #{type}\n" out += "#{pref}.content:: #{content}\n" out end end end
Version data entries
16 entries across 16 versions & 1 rubygems