Class: RASN1::Types::Null

Inherits:
Primitive show all
Defined in:
lib/rasn1/types/null.rb

Overview

ASN.1 Null

Author:

  • Sylvain Daubert

Constant Summary collapse

ID =

Null id value

0x05

Constants inherited from Primitive

Primitive::ASN1_PC

Constants inherited from Base

Base::CLASSES, Base::CLASS_MASK, Base::INDEFINITE_LENGTH, Base::MULTI_OCTETS_ID

Instance Attribute Summary

Attributes inherited from Base

#asn1_class, #default, #name, #options

Instance Method Summary collapse

Methods inherited from Base

#==, constrained?, #constructed?, #do_parse_explicit_with_tracing, #do_parse_with_tracing, encoded_type, #explicit?, #id, #implicit?, #initialize, #initialize_copy, #optional?, parse, #parse!, #primitive?, #specific_initializer, start_tracing, stop_tracing, #tagged?, #to_der, #trace, type, #type, #value, #value=, #value?, #value_size, #void_value

Constructor Details

This class inherits a constructor from RASN1::Types::Base

Instance Method Details

#can_build?Boolean

Build only if not optional

Returns:



20
21
22
# File 'lib/rasn1/types/null.rb', line 20

def can_build?
  !optional?
end

#inspect(level = 0) ⇒ String

Returns:

  • (String)


12
13
14
15
16
# File 'lib/rasn1/types/null.rb', line 12

def inspect(level=0)
  str = common_inspect(level)[0..-2] # remove terminal ':'
  str << ' OPTIONAL' if optional?
  str
end