lib/analysis_sr_stage_mixin.rb
def count_by_pattern(list)
    list.inject({}) {|ac, v|
      ac[v[1]] ||= 0
      ac[v[1]] += 1
      ac
    }
  end
# Count how many DC belongs to each pattern
Count how many DC belongs to each pattern
Count how many DC belongs to each pattern
def count_by_pattern(list)
    list.inject({}) {|ac, v|
      ac[v[1]] ||= 0
      ac[v[1]] += 1
      ac
    }
  end
def count_by_pattern ( list ) list . inject ( { } ) { | ac , v | ac [ v [ 1 ] ] ||= 0 ac [ v [ 1 ] ] += 1 ac } end
Count how many DC belongs to each pattern
Count how many DC belongs to each pattern
list