class InfluxDB::LineProtocol::CompatUnescapes

Public Instance Methods

unescape(field, str) click to toggle source
# File lib/influxdb/lineprotocol/parser.rb, line 670
def unescape(field, str)
  case field
  when :measurement
    # escaped comma or space anywhere
    str.gsub(/\\([, ])/, '\\1')
  when :tag_key, :tag_value, :field_key
    # escaped comma, equals, or space anywhere
    str.gsub(/\\([,= ])/, '\\1')
  when :string
    # escaped quote anywhere
    str.gsub(/\\"/, '"')
  end
end