Class: ActiveRecord::QueryLogs::LegacyFormatter
Do not use. This class is for internal use only.
Relationships & Source Files | |
Extension / Inclusion / Inheritance Descendants | |
Subclasses:
|
|
Inherits: | Object |
Defined in: | activerecord/lib/active_record/query_logs_formatter.rb |
Class Method Summary
- .new ⇒ LegacyFormatter constructor
Instance Attribute Summary
- #key_value_separator readonly private
Instance Method Summary
-
#format(pairs)
Formats the key value pairs into a string.
- #format_value(value) private
Constructor Details
.new ⇒ LegacyFormatter
# File 'activerecord/lib/active_record/query_logs_formatter.rb', line 6
def initialize @key_value_separator = ":" end
Instance Attribute Details
#key_value_separator (readonly, private)
[ GitHub ]# File 'activerecord/lib/active_record/query_logs_formatter.rb', line 18
attr_reader :key_value_separator
Instance Method Details
#format(pairs)
Formats the key value pairs into a string.
# File 'activerecord/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
#format_value(value) (private)
[ GitHub ]# File 'activerecord/lib/active_record/query_logs_formatter.rb', line 20
def format_value(value) value end