Class: RASN1::Types::Constructed Abstract
- Defined in:
- lib/rasn1/types/constructed.rb
Overview
This class is abstract.
This class SHOULD be used as base class for all ASN.1 primitive types.
Base class for all ASN.1 constructed types
Direct Known Subclasses
Constant Summary collapse
- ASN1_PC =
Constructed value
0x20
Constants inherited from Base
Base::CLASSES, Base::INDEFINITE_LENGTH, Base::MAX_TAG
Instance Attribute Summary
Attributes inherited from Base
#asn1_class, #default, #name, #value
Instance Method Summary collapse
Methods inherited from Base
#==, #constructed?, #explicit?, #implicit?, #initialize, #initialize_copy, #optional?, parse, #parse!, #primitive?, #tag, #tagged?, #to_der, #type, type, #value_size
Constructor Details
This class inherits a constructor from RASN1::Types::Base
Instance Method Details
#inspect(level = 0) ⇒ Object
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/rasn1/types/constructed.rb', line 12 def inspect(level=0) case @value when Array str = '' str << ' ' * level if level > 0 str << "#{@name} " unless @name.nil? level = level.abs str << "#{type}:\n" level += 1 @value.each do |item| case item when Base, Model next if item.optional? and item.value.nil? str << ' ' * level str << "#{item.inspect(level)}\n" else str << item.inspect end end str else super end end |