Class: ActiveRecord::SqlCommenter::QueryLogs::Formatter
- Inherits:
-
Object
- Object
- ActiveRecord::SqlCommenter::QueryLogs::Formatter
- Defined in:
- lib/active_record/sql_commenter/query_logs_formatter.rb
Instance Attribute Summary collapse
-
#key_value_separator ⇒ Object
readonly
Returns the value of attribute key_value_separator.
Instance Method Summary collapse
-
#initialize ⇒ Formatter
constructor
A new instance of Formatter.
-
#quote_value(value) ⇒ String
pairs.
Constructor Details
#initialize ⇒ Formatter
Returns a new instance of Formatter.
9 10 11 |
# File 'lib/active_record/sql_commenter/query_logs_formatter.rb', line 9 def initialize @key_value_separator = "=" end |
Instance Attribute Details
#key_value_separator ⇒ Object (readonly)
Returns the value of attribute key_value_separator.
7 8 9 |
# File 'lib/active_record/sql_commenter/query_logs_formatter.rb', line 7 def key_value_separator @key_value_separator end |
Instance Method Details
#quote_value(value) ⇒ String
pairs.
16 17 18 |
# File 'lib/active_record/sql_commenter/query_logs_formatter.rb', line 16 def quote_value(value) "'#{value.gsub("'", "\\\\'")}'" end |