# coding: ASCII-8BIT class ASN1Kit::Set < ASN1Kit::Type asn1_tag :IMPLICIT, :UNIVERSAL, 17 asn1_alias "SET" class << self def [](*component_types) ret = Class.new(self) hash = component_types.map { |c| [c.name, c] }.to_h ret.const_set(:COMPONENT_TYPES, hash) ret end private def inspect_inner ctypes = self::COMPONENT_TYPES.values.map { |c| c.inspect }.join(", ") "{ #{ctypes} }" end end def to_der content = self.class::COMPONENT_TYPES.map { |name, type, opts| next nil unless @value[name] @value[name].to_der }.compact.join der_header(content.bytesize, :constructed) << content end end