123456789_123456789_123456789_123456789_123456789_

Module: DidYouMean::Experimental::InitializerNameCorrection

Relationships & Source Files
Extension / Inclusion / Inheritance Descendants
Included In:
Defined in: lib/did_you_mean/experimental/initializer_name_correction.rb

Instance Method Summary

Instance Method Details

#method_added(name)

[ GitHub ]

  
# File 'lib/did_you_mean/experimental/initializer_name_correction.rb', line 8

def method_added(name)
  super

  distance = Levenshtein.distance(name.to_s, 'initialize')
  if distance != 0 && distance <= 2
    warn "warning: #{name} might be misspelled, perhaps you meant initialize?"
  end
end