Class: ActiveRecord::QueryLogs::LegacyFormatter
- Inherits:
-
Object
- Object
- ActiveRecord::QueryLogs::LegacyFormatter
- Defined in:
- lib/active_record/query_logs_formatter.rb
Overview
:nodoc:
Direct Known Subclasses
Instance Method Summary collapse
-
#format(pairs) ⇒ Object
Formats the key value pairs into a string.
-
#initialize ⇒ LegacyFormatter
constructor
A new instance of LegacyFormatter.
Constructor Details
#initialize ⇒ LegacyFormatter
Returns a new instance of LegacyFormatter.
6 7 8 |
# File 'lib/active_record/query_logs_formatter.rb', line 6 def initialize @key_value_separator = ":" end |
Instance Method Details
#format(pairs) ⇒ Object
Formats the key value pairs into a string.
11 12 13 14 15 |
# File 'lib/active_record/query_logs_formatter.rb', line 11 def format(pairs) pairs.map! do |key, value| "#{key}#{key_value_separator}#{format_value(value)}" end.join(",") end |