Sha256: 6e7f50684880f95cbe74a29f12aec55e6ee0a7ddba86d1f03af5418b18f06a50
Contents?: true
Size: 628 Bytes
Versions: 19
Compression:
Stored size: 628 Bytes
Contents
require 'link_thumbnailer/model' require 'link_thumbnailer/grader' module LinkThumbnailer module Models class Description < ::LinkThumbnailer::Model attr_reader :node, :text, :position attr_accessor :score def initialize(node, text, position = 1) @node = node @text = sanitize(text) @position = position @score = compute_score end def to_s text end def <=>(other) score <=> other.score end private def compute_score ::LinkThumbnailer::Grader.new(self).call end end end end
Version data entries
19 entries across 19 versions & 1 rubygems