Module: SanitizeHtmlFields::ClassMethods

Included in:
InstanceMethods
Defined in:
lib/sanitize_html_fields/sanitize_html_fields.rb

Instance Method Summary collapse

Instance Method Details

#sanitize_html_fields(options = {}) ⇒ Object



10
11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/sanitize_html_fields/sanitize_html_fields.rb', line 10

def sanitize_html_fields(options = {})
  send :include, InstanceMethods
  send :before_save, :convert_html_fields

  cattr_accessor :shf_convert_newlines
  self.shf_convert_newlines = options.delete(:convert_newlines) || false

  cattr_accessor :shf_remove_excessive_whitespaces
  self.shf_remove_excessive_whitespaces = options.delete(:remove_excessive_whitespaces) || true

  cattr_accessor :shf_options
  self.shf_options = options
end