Sha256: e43ca381b0d507237a5731815f93ccf12ad6b105fdc2dd13bfbf29a14fda9946
Contents?: true
Size: 1.05 KB
Versions: 30
Compression:
Stored size: 1.05 KB
Contents
module RelatonIeee class Committee # @return [String] attr_reader :type, :name # @return [String, NilClass] attr_reader :chair # @param type [String] # @param name [String] # @param chair [String, NilClass] def initialize(type:, name:, chair: nil) @type = type @name = name @chair = chair end # @param builder [Nokogiri::XML::Builder] def to_xml(builder) builder.committee type: type do |b| b.name name b.chair chair if chair end end # @return [Hash] def to_hash hash = { "type" => type, "name" => name } hash["chair"] = chair if chair hash end # @param prefix [String] # @param count [Integer] # @return [String] def to_asciibib(prefix, count) pref = prefix.empty? ? prefix : prefix + "." pref += "committee" out = count > 1 ? "#{pref}::\n" : "" out += "#{pref}.type:: #{type}\n" out += "#{pref}.name:: #{name}\n" out += "#{pref}.chair:: #{chair}\n" if chair out end end end
Version data entries
30 entries across 30 versions & 1 rubygems