Sha256: 7f6a920a94c091f8970cc0095a5e28e0eb57b97bfb5b8eb8c525fe2957735f4e

Contents?: true

Size: 803 Bytes

Versions: 3

Compression:

Stored size: 803 Bytes

Contents

# frozen_string_literal: true

module RASN1
  module Types
    # @abstract This class SHOULD be used as base class for all ASN.1 primitive
    #  types.
    # Base class for all ASN.1 constructed types
    # @author Sylvain Daubert
    class Constructed < Base
      # Constructed value
      ASN1_PC = 0x20

      def inspect(level=0)
        case @value
        when Array
          str = common_inspect(level)
          str << "\n"
          level = level.abs + 1
          @value.each do |item|
            case item
            when Base, Model
              str << "#{item.inspect(level)}\n"
            else
              str << '  ' * level
              str << "#{item.inspect}\n"
            end
          end
          str
        else
          super
        end
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
rasn1-0.11.0 lib/rasn1/types/constructed.rb
rasn1-0.10.0 lib/rasn1/types/constructed.rb
rasn1-0.9.0 lib/rasn1/types/constructed.rb