Module: GeoCombine::Formatting
- Included in:
- EsriOpenData
- Defined in:
- lib/geo_combine/formatting.rb
Overview
Mixin used for formatting metadata fields
Instance Method Summary collapse
-
#remove_lines(text) ⇒ String
Removes line breaks from a text input.
-
#sanitize(text) ⇒ String
Sanitizes html from a text input.
-
#sanitize_and_remove_lines(text) ⇒ String
Sanitizes and removes lines from a text block.
Instance Method Details
#remove_lines(text) ⇒ String
Removes line breaks from a text input
17 18 19 |
# File 'lib/geo_combine/formatting.rb', line 17 def remove_lines(text) text.gsub(/\n/, '') end |
#sanitize(text) ⇒ String
Sanitizes html from a text input
9 10 11 |
# File 'lib/geo_combine/formatting.rb', line 9 def sanitize(text) Sanitize.fragment(text) end |
#sanitize_and_remove_lines(text) ⇒ String
Sanitizes and removes lines from a text block
25 26 27 |
# File 'lib/geo_combine/formatting.rb', line 25 def sanitize_and_remove_lines(text) remove_lines(sanitize(text)) end |