Sha256: c77c13f07b3bae5b86d697c83a4fd60dd4e104b31f0a2884690577c92f27d6d8

Contents?: true

Size: 697 Bytes

Versions: 2

Compression:

Stored size: 697 Bytes

Contents

require "active_record"
require "active_support/core_ext"
require "acts_as_content_highlightable/version"
require "acts_as_content_highlightable/html_node_parser"
require "acts_as_content_highlightable/model"
require "acts_as_content_highlightable/engine"

module ActsAsContentHighlightable

  mattr_accessor :unique_html_node_identifier_key
  self.unique_html_node_identifier_key = "chnode"

  mattr_accessor :mount
  self.mount = true

  def self.extract_text_from_html(text)
    return nil unless text.is_a? String
    return ActsAsContentHighlightable::HtmlNodeParser.new(text).body_text
  end

  ActiveSupport.on_load(:active_record) do
    extend ActsAsContentHighlightable::Model
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
acts_as_content_highlightable-0.2.1 lib/acts_as_content_highlightable.rb
acts_as_content_highlightable-0.2.0 lib/acts_as_content_highlightable.rb