Sha256: 305e1da9c45d649157445b4872a4c2765ed0c66cdd9bad10bb9e2833642fc013

Contents?: true

Size: 454 Bytes

Versions: 8

Compression:

Stored size: 454 Bytes

Contents

module Ulla
  class EnvironmentClassHash < Hash

    def group_by_non_residue_labels
      self.values.group_by { |env| env.label[1..-1] }
    end

    def groups_sorted_by_residue_labels
      group_by_non_residue_labels.to_a.sort_by { |env_group|
        env_group[0].split('').map_with_index { |l, i|
          $env_features[i + 1].labels.index(l)
        }
      }
    end

    def group_size
      group_by_non_residue_labels.size
    end
  end
end

Version data entries

8 entries across 8 versions & 2 rubygems

Version Path
semin-ulla-0.9.3 lib/ulla/environment_class_hash.rb
semin-ulla-0.9.4 lib/ulla/environment_class_hash.rb
semin-ulla-0.9.5 lib/ulla/environment_class_hash.rb
semin-ulla-0.9.6 lib/ulla/environment_class_hash.rb
ulla-0.9.3 lib/ulla/environment_class_hash.rb
ulla-0.9.4 lib/ulla/environment_class_hash.rb
ulla-0.9.6 lib/ulla/environment_class_hash.rb
ulla-0.9.5 lib/ulla/environment_class_hash.rb