Sha256: a6e40086c4963d74e511772e1b908b9e7559365ab02e70db966108ab9204d05f

Contents?: true

Size: 603 Bytes

Versions: 2

Compression:

Stored size: 603 Bytes

Contents

module Middleman::Blog::Similar::BlogArticleExtensions
  def similar_articles
    if !@similar_articles && similarity_algorithm
      @similar_articles = similarity_algorithm.similar_articles
    end
    @similar_articles || []
  end
  def words
    unless @words && similarity_algorithm
      @words = similarity_algorithm.words
    end
    @words
  end
  def similarity_algorithm
    if !@similarity_algorithm && (algorithm = app.similarity_algorithm)
      @similarity_algorithm = algorithm.new self
    end
    @similarity_algorithm
  end
  def untagged_body
    body.gsub(/<[^>]*>/ui,'')
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
middleman-blog-similar-1.1.1 lib/middleman-blog-similar/blog_article_extensions.rb
middleman-blog-similar-1.1.0 lib/middleman-blog-similar/blog_article_extensions.rb