Sha256: a144099271ad702fefde031d00f39b5334ddea0151d2d83a628fe16677a5bbe5

Contents?: true

Size: 693 Bytes

Versions: 8

Compression:

Stored size: 693 Bytes

Contents

require 'csv'

module Mondrian::REST::Formatters
  module CSV
    def self.call(result, env)
      params = env['api.endpoint'].params
      add_parents = params['parents']
      debug = params['debug']
      sparse = params['sparse']
      properties = params['properties'] || []

      rows = Mondrian::REST::Formatters.tidy(result,
                                             add_parents: add_parents,
                                             debug: debug,
                                             properties: properties,
                                             sparse: sparse)

      ::CSV.generate do |csv|
        rows.each { |row| csv << row }
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
mondrian-rest-1.0.4-java lib/mondrian_rest/formatters/csv.rb
mondrian-rest-1.0.3-java lib/mondrian_rest/formatters/csv.rb
mondrian-rest-1.0.2-java lib/mondrian_rest/formatters/csv.rb
mondrian-rest-1.0.1-java lib/mondrian_rest/formatters/csv.rb
mondrian-rest-1.0.0-java lib/mondrian_rest/formatters/csv.rb
mondrian-rest-0.7.9-java lib/mondrian_rest/formatters/csv.rb
mondrian-rest-0.7.8-java lib/mondrian_rest/formatters/csv.rb
mondrian-rest-0.7.7-java lib/mondrian_rest/formatters/csv.rb