Sha256: fe6bf0db2480115a0582b059a3624778db41cdc04b1c341688692ecb2b56d5a9

Contents?: true

Size: 608 Bytes

Versions: 7

Compression:

Stored size: 608 Bytes

Contents

require 'csv'

module Mondrian::REST::Formatters
  module CSV
    def self.call(result, env)
      qh = env['rack.request.query_hash']
      add_parents = qh['parents'] == 'true'
      debug = qh['debug'] == 'true'
      properties = qh['properties'] || []

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

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

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
mondrian-rest-0.7.6-java lib/mondrian_rest/formatters/csv.rb
mondrian-rest-0.7.5-java lib/mondrian_rest/formatters/csv.rb
mondrian-rest-0.7.4-java lib/mondrian_rest/formatters/csv.rb
mondrian-rest-0.7.3-java lib/mondrian_rest/formatters/csv.rb
mondrian-rest-0.7.2-java lib/mondrian_rest/formatters/csv.rb
mondrian-rest-0.7.1-java lib/mondrian_rest/formatters/csv.rb
mondrian-rest-0.7.0-java lib/mondrian_rest/formatters/csv.rb