Class: Krikri::Enrichments::StripHtml

Inherits:
Object
  • Object
show all
Includes:
FieldEnrichment
Defined in:
lib/krikri/enrichments/strip_html.rb

Overview

Enrichment to capitalize sentences in a text field

StripHtml.new.enrich_value('<html>Moomin <i><b>Valley</i></b>')
=> 'Moomin Valley'

Constant Summary

Constants included from SoftwareAgent

SoftwareAgent::Logger

Instance Method Summary collapse

Methods included from FieldEnrichment

#enrich, #enrich_all, #enrich_field

Methods included from Krikri::Enrichment

#enrich, #enrich!, #list_fields

Methods included from SoftwareAgent

#agent_name, #log, #run

Instance Method Details

#enrich_value(value) ⇒ Object


11
12
13
14
# File 'lib/krikri/enrichments/strip_html.rb', line 11

def enrich_value(value)
  return value unless value.is_a? String
  ActionView::Base.full_sanitizer.sanitize(value)
end