Class: Roart::ContentFormatter

Inherits:
Object
  • Object
show all
Defined in:
lib/roart/core/content_formatter.rb

Class Method Summary collapse

Class Method Details

.format_string(string) ⇒ Object

The following is only based on quick trial&error on my part. The RT Api (at least in 3.6) does not have good documentation. Strings in a RT request:

- are not allowed to contain '\r'
- must use equally padded new-lines to distinguish them from the beginning of a new field (we use 2-space padding)


7
8
9
# File 'lib/roart/core/content_formatter.rb', line 7

def self.format_string(string)
  string.gsub("\r", '').gsub("\n", "\n  ")
end