Class: RASN1::Types::Integer

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

Overview

ASN.1 Integer

Author:

  • Sylvain Daubert

Direct Known Subclasses

Enumerated

Constant Summary collapse

TAG =
0x02

Constants inherited from Primitive

Primitive::ASN1_PC

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, #inspect, #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

#to_iInteger

Returns:



10
11
12
# File 'lib/rasn1/types/integer.rb', line 10

def to_i
  @value || @default || 0
end