Class: DatadogExporter::Monitors::Utilities::NameTransformer
- Inherits:
-
Object
- Object
- DatadogExporter::Monitors::Utilities::NameTransformer
- Defined in:
- lib/datadog_exporter/monitors/utilities/name_transformer.rb
Overview
This class transform the monitor name to a valid file name
Instance Method Summary collapse
-
#transform(name) ⇒ String
Transforms the monitor name to a valid file name.
Instance Method Details
#transform(name) ⇒ String
Transforms the monitor name to a valid file name
12 13 14 |
# File 'lib/datadog_exporter/monitors/utilities/name_transformer.rb', line 12 def transform(name) name.downcase.gsub(/\s*\|\s*/, "_").tr("/", "_").gsub(/\s+/, "_") end |