lib/core/core_setup_init.rb
# Uses attributes level detected to initialize the list of steps/orders.
Uses attributes level detected to initialize the list of steps/orders.
Uses attributes level detected to initialize the list of steps / orders .
def _setup_bs_levels(attrs, level)
      steps = [[]]
      pos = 0
      loop do
        attrs.clone.each do |k, v|
          cur_level = v.rh_get(:group, :level)
          next unless cur_level == level
          attrs_to_add = v[:attrs] + v.rh_get(:group, :attrs).uniq
          attrs.reject! do |attr, _|
            res = attrs_to_add.include?(attr)
            steps[pos] << { attr => attrs[attr] } if res
            res
          end
          steps[pos + 1] = [] if steps[pos + 1].nil?
          steps[pos + 1] << { k => attrs[k] }
          attrs.reject! { |attr, _| attr == k }
        end
        level += 1
        break if level == 0
        pos += 1
      end
      steps
    end
def _setup_bs_levels ( attrs , level ) steps = [ [ ] ] pos = 0 loop do attrs . clone . each do | k , v | cur_level = v . rh_get ( :group , :level ) next unless cur_level == level attrs_to_add = v [ :attrs ] + v . rh_get ( :group , :attrs ) . uniq attrs . reject! do | attr , _ | res = attrs_to_add . include? ( attr ) steps [ pos ] << { attr => attrs [ attr ] } if res res end steps [ pos + 1 ] = [ ] if steps [ pos + 1 ] . nil? steps [ pos + 1 ] << { k => attrs [ k ] } attrs . reject! { | attr , _ | attr == k } end level += 1 break if level == 0 pos += 1 end steps end
Uses attributes level detected to initialize the list of steps/orders.
Uses attributes level detected to initialize the list of steps / orders .
attrs
<not_specific>
level
<not_specific>