Class: SnailParser::Formatter::Vim

Inherits:
SnailParser::Formatter show all
Defined in:
lib/snail_parser/formatter/vim.rb

Instance Method Summary collapse

Methods inherited from SnailParser::Formatter

#initialize

Constructor Details

This class inherits a constructor from SnailParser::Formatter

Instance Method Details

#reportObject



2
3
4
5
6
7
8
9
# File 'lib/snail_parser/formatter/vim.rb', line 2

def report
  rows = @result.each_with_object([]) do |row, result|
    line = row.map { |key, value| "'#{key}':#{cast_value_to_vim_object(value)}" }
    result << "{#{line.join(',')}}"
  end

  "[#{rows.join(',')}]"
end