Module: RASN1::Types::Constrained

Extended by:
ClassMethods
Defined in:
lib/rasn1/types/constrained.rb

Overview

Mixin to add constraints on a RASN1 type. Should not be used directly but through define_type.

Author:

  • Sylvain Daubert

Version:

  • 0.11.0

Defined Under Namespace

Modules: ClassMethods

Instance Attribute Summary

Attributes included from ClassMethods

#constraint

Instance Method Summary collapse

Methods included from ClassMethods

check_constraint, constrained?

Instance Method Details

#value=(val) ⇒ Object

Redefined #value= to check constraint before assigning val

Raises:

See Also:



35
36
37
38
# File 'lib/rasn1/types/constrained.rb', line 35

def value=(val)
  self.class.check_constraint(val)
  super
end