class DataMetaPii::AppLink

AppLink Attribute Division VO, i.e. full Application Link Definition

@!attribute [rw] sectVos

@return [Hash] the Hash keyed by the application name symbol pointing to a Hash keyed by the Abstract
    PII field key pointing to the instance of AttrSect.

@!attribute [rw] reusables

@return [Hash] +nil+ or the Hash keyed by reusable var name pointing to the instance of AttrSect
    PII field key pointing to the instance of AttrSect.

Constants

INDENT

Use same ident as the main class:

Attributes

reusables[RW]
sectVos[RW]

Public Class Methods

new(ver, vos, reusables = nil) click to toggle source

Creates an instance for the given parameters, see the properties with the same names.

Calls superclass method DataMetaPii::VersionedVo::new
# File lib/dataMetaPii.rb, line 330
def initialize(ver, vos, reusables = nil)
    super(ver)
    @sectVos, @reusables = vos, reusables
end

Public Instance Methods

resolveRefs() click to toggle source

Resolves reusable variable references, reports errors

# File lib/dataMetaPii.rb, line 336
def resolveRefs()
    raise ArgumentError, 'Sections are not set yet on this instance' unless @sectVos
    return self unless @reusables # no reusables defined, all vars should be accounted for
    @reusables.keys.each { |uk|
       ref = @reusables[uk].refs
       ref.keys.each { |rk|
          raise ArgumentError, %<Reusable "#{uk}" references "#{rk}" which is not defined> unless @reusables[rk]
       }
    }
    @sectVos.keys.each { |ak|
        app = @sectVos[ak]
        app.keys.each { |sk|
            sect = app[sk]
            sect.refs.keys.each { |rk|
                raise ArgumentError, %<In the app "#{ak}": the field "#{sk}" references "#{
                        rk}" which is not defined> unless @reusables[rk]
            }
        }

    }
    self
end
to_s() click to toggle source

String representation

# File lib/dataMetaPii.rb, line 360
def to_s
    %<#{self.class.name}{apps=#{@sectVos.inspect}>
end