Module: RailsLens::TomlFormat

Defined in:
lib/rails_lens/toml_format.rb

Overview

Small helpers for emitting TOML fragments used throughout annotation output.

Class Method Summary collapse

Class Method Details

.quoted_array(values) ⇒ Object

Format an array of values as a TOML inline array of quoted strings:

quoted_array(["a", "b"]) => %(["a", "b"])


10
11
12
# File 'lib/rails_lens/toml_format.rb', line 10

def quoted_array(values)
  "[#{values.map { |v| "\"#{v}\"" }.join(', ')}]"
end