aboutsummaryrefslogtreecommitdiffstats
path: root/lib/asn1kit/types/choice.rb
blob: 04edef4558d1a800d010a5a31c5955e4bbd014a9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
# coding: ASCII-8BIT

class ASN1Kit::Choice < ASN1Kit::Type
  class << self
    def [](*alternative_types)
      # FIXME
      ret = Class.new(self)
      hash = alternative_types.to_h
      ret.const_set(:ALTERNATIVE_TYPES, hash)
      ret
    end
  end

  def to_der
    @value.to_der
    # replace tag
  end
end