Class: LinkThumbnailer::Graders::LinkDensity

Inherits:
Base
  • Object
show all
Defined in:
lib/link_thumbnailer/graders/link_density.rb

Instance Attribute Summary

Attributes inherited from Base

#config, #description, #options

Instance Method Summary collapse

Methods inherited from Base

#initialize, #weight

Constructor Details

This class inherits a constructor from LinkThumbnailer::Graders::Base

Instance Method Details

#callObject



5
6
7
8
# File 'lib/link_thumbnailer/graders/link_density.rb', line 5

def call
  return 0.0 if text.length == 0
  1.0 - (links.count.to_f / text.length.to_f)
end