Class: RetroIDL::ASN::BuiltinValue

Inherits:
Object
  • Object
show all
Defined in:
lib/retro_idl/asn/builtin_value.rb

Overview

BuiltinValue aggregation

X.680 section 17.2

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**opts) ⇒ BuiltinValue

Returns a new instance of BuiltinValue.



25
26
27
28
29
30
31
# File 'lib/retro_idl/asn/builtin_value.rb', line 25

def initialize(**opts)

    @location = opts[:location]
    @mod = nil
    @value = opts[:value]
    
end

Instance Attribute Details

#valueArray, ... (readonly)

return the Ruby native representation of this BuiltinType

Returns:

  • (Array, Hash, Numeric, String)

    native value

Raises:

  • (ASNError)

    value cannot be returned if object is not linked



38
39
40
# File 'lib/retro_idl/asn/builtin_value.rb', line 38

def value
  @value
end

Instance Method Details



47
48
49
# File 'lib/retro_idl/asn/builtin_value.rb', line 47

def link(mod, stack)
    @mod = mod
end

#to_sString

Convert object to ASN.1 syntax representation

Returns:

  • (String)

    ASN.1 syntax representation

Raises:



41
42
43
44
45
# File 'lib/retro_idl/asn/builtin_value.rb', line 41

def to_s

    "#{@value}"
    
end