Class: RetroIDL::ASN::DefinedValue
- Inherits:
-
Object
- Object
- RetroIDL::ASN::DefinedValue
- Defined in:
- lib/retro_idl/asn/defined_value.rb
Overview
X.680 section 17.3
Instance Method Summary collapse
-
#initialize(**opts) ⇒ DefinedValue
constructor
A new instance of DefinedValue.
-
#link(mod, stack) ⇒ MODULE?
resolve symbols to definitions in module.
-
#to_s ⇒ String
Convert object to ASN.1 syntax representation.
-
#value ⇒ Array, ...
return the Ruby native representation of this DefinedType.
Constructor Details
#initialize(**opts) ⇒ DefinedValue
Returns a new instance of DefinedValue.
24 25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/retro_idl/asn/defined_value.rb', line 24 def initialize(**opts) @location = opts[:location] @mod = nil if RetroIDL::ASN.is_identifier?(@location, **opts[:ref]) @symbol = opts[:ref].to_s else raise ASNError end end |
Instance Method Details
#link(mod, stack) ⇒ MODULE?
resolve symbols to definitions in module
38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 |
# File 'lib/retro_idl/asn/defined_value.rb', line 38 def link(mod, stack) if @mod.nil? or @mod != mod @mod = nil if mod.symbol(@symbol) if mod.symbol(@symbol).link(mod, []) super(mod, stack) end else ASN.putError(@location, "DefinedValue governing type is not defined") end end @mod end |
#to_s ⇒ String
Convert object to ASN.1 syntax representation
76 77 78 79 80 |
# File 'lib/retro_idl/asn/defined_value.rb', line 76 def to_s "#{@symbol}" end |
#value ⇒ Array, ...
return the Ruby native representation of this DefinedType
69 70 71 72 73 |
# File 'lib/retro_idl/asn/defined_value.rb', line 69 def value @mod.symbol(@symbol).value end |