gistlib
other ruby categories
code-refactoring code snippets in ruby
change it to one-liner : `def compute(dn1, dn2) raise argumenterror if dn1.length != dn2.length count = 0 dn1.length.times do |i| count += 1 if dn1[i] != dn2[i] end count end end` in ruby
change to oneliner: `class flattenarray def self.flatten(ar) [] if ar.nil? ar.flatten.compact end end` in ruby
gistlib
by LogSnag