Class: LinkThumbnailer::Graders::LinkDensity
- 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
Constructor Details
This class inherits a constructor from LinkThumbnailer::Graders::Base
Instance Method Details
#call ⇒ Object
7 8 9 10 |
# File 'lib/link_thumbnailer/graders/link_density.rb', line 7 def call return 0.0 if text.length == 0 1.0 - (links.count.to_f / text.length.to_f) end |