Class: InfluxDB::LineProtocol::CompatUnescapes
- Inherits:
-
Object
- Object
- InfluxDB::LineProtocol::CompatUnescapes
- Defined in:
- lib/influxdb/lineprotocol/parser.rb
Overview
Parser
Instance Method Summary collapse
Instance Method Details
#unescape(field, str) ⇒ Object
670 671 672 673 674 675 676 677 678 679 680 681 682 |
# 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 |