Class: Classification::ClassParam

Inherits:
Base
  • Object
show all
Defined in:
app/models/classification/class_param.rb

Instance Method Summary collapse

Methods inherited from Base

#inherited_values, #initialize

Constructor Details

This class inherits a constructor from Classification::Base

Instance Method Details

#encObject


4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# File 'app/models/classification/class_param.rb', line 4

def enc
  key_hash = hashed_class_parameters
  values   = values_hash

  klasses = {}
  classes.each do |klass|
    klasses[klass.name] ||= {}
    if key_hash[klass.id]
      key_hash[klass.id].each do |key|
        klasses[klass.name][key.to_s] = value_of_key(key, values)
      end
    else
      klasses[klass.name] = nil
    end
  end
  klasses
end