lib/core/core_setup_init.rb
# Internal setup function - Identify a list of attributes from depends_on
#
# If the attribute has a object dependency, attributes attached are added.
# If the object has depends_on
Internal setup function - Identify a list of attributes from depends_on
If the attribute has a object dependency, attributes attached are added.
If the object has depends_on
Internal setup function - Identify a list of attributes from depends_on If the attribute has a object dependency attributes attached are added . If the object has depends_on
def _setup_attrs_depends_on(dependencies, attr_name, attrs)
      return [] unless attrs.is_a?(Array) && attrs.length > 0
      result = []
      Lorj.debug(3, "%s: depends on added '%s'", attr_name, attrs.join(', '))
      attrs.each do |a|
        data = Lorj.data.auto_section_data(a)
        if data.rh_exist?(:list_values, :object)
          element = _setup_bs_objs_deps(dependencies,
                                        data.rh_get(:list_values, :object))
          element[:attrs] += dependencies.rh_get(:object, element[:obj], :attrs)
        else
          element = { :attrs => [] }
        end
        if data[:depends_on].is_a?(Array)
          element[:depends_on] = _setup_attrs_depends_on(dependencies, a,
                                                         data[:depends_on])
        else
          element[:depends_on] = []
        end
        attrs_list = element[:attrs] + element[:depends_on]
        attrs_list.uniq!
        result += attrs_list
      end
      result.uniq
    end
def _setup_attrs_depends_on ( dependencies , attr_name , attrs ) return [ ] unless attrs . is_a? ( Array ) && attrs . length > 0 result = [ ] Lorj . debug ( 3 , "%s: depends on added '%s'" , attr_name , attrs . join ( ', ' ) ) attrs . each do | a | data = Lorj . data . auto_section_data ( a ) if data . rh_exist? ( :list_values , :object ) element = _setup_bs_objs_deps ( dependencies , data . rh_get ( :list_values , :object ) ) element [ :attrs ] += dependencies . rh_get ( :object , element [ :obj ] , :attrs ) else element = { :attrs => [ ] } end if data [ :depends_on ] . is_a? ( Array ) element [ :depends_on ] = _setup_attrs_depends_on ( dependencies , a , data [ :depends_on ] ) else element [ :depends_on ] = [ ] end attrs_list = element [ :attrs ] + element [ :depends_on ] attrs_list . uniq! result += attrs_list end result . uniq end
Internal setup function - Identify a list of attributes from depends_on
If the attribute has a object dependency, attributes attached are added.
Internal setup function - Identify a list of attributes from depends_on If the attribute has a object dependency attributes attached are added .
dependencies
<not_specific>
attr_name
<not_specific>
attrs
<not_specific>