Class: Locca::CollectionItemDefaultFormatter
- Inherits:
-
Object
- Object
- Locca::CollectionItemDefaultFormatter
- Defined in:
- lib/locca/collection_item_default_formatter.rb
Instance Method Summary collapse
Instance Method Details
#format_item(item) ⇒ Object
27 28 29 30 31 32 33 34 35 36 |
# File 'lib/locca/collection_item_default_formatter.rb', line 27 def format_item(item) key = item.key.gsub(/([^\\])"/, "\\1\\\"") value = item.value.gsub(/([^\\])"/, "\\1\\\"") result = "" result << "/* #{item.comment} */\n" if item.comment result << "\"#{key}\" = \"#{value}\";\n" return result end |