Class: RetroIDL::ASN::BaseValue

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

Overview

methods and attributes common to ASN.1 values

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**opts) ⇒ BaseValue

Returns a new instance of BaseValue.



23
24
25
# File 'lib/retro_idl/asn/base_value.rb', line 23

def initialize(**opts)            
    @value = opts[:value]                
end

Instance Attribute Details

#governorObject (readonly)

Returns the value of attribute governor.



27
28
29
# File 'lib/retro_idl/asn/base_value.rb', line 27

def governor
  @governor
end

#idString, NilClass (readonly)

Returns identifier.

Returns:

  • (String, NilClass)

    identifier



30
31
32
# File 'lib/retro_idl/asn/base_value.rb', line 30

def id
  @id
end

Class Method Details

.===(otherClass) ⇒ Object



61
62
63
64
65
66
67
68
69
70
71
72
73
# File 'lib/retro_idl/asn/base_value.rb', line 61

def self.===(otherClass)

    if self == otherClass

        true

    else

        false

    end

end

Instance Method Details

resolve symbols to definitions in module

Parameters:

  • mod (MODULE)

    module this type belongs to

  • stack (Array)

    objects called before this object for depth first search of recursion

Returns:

  • (MODULE)

    object has been linked

  • (nil)

    object has not been linked



33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
# File 'lib/retro_idl/asn/base_value.rb', line 33

def link(mod, stack)

    if @mod.nil? or @mod != mod

        @mod = nil

        if @governor.link(mod, stack.push(self))

            if @governor.evaluate(value)

                @mod = mod

            else

                ASN.putError(@location, "evaluate didn't work")
                
            end

        end

    else

        @mod

    end
    
end