cartodb-4.42/services/datasources/spec/doubles/json_to_csv_converter.rb
2024-04-06 05:25:13 +00:00

23 lines
504 B
Ruby

module CartoDB
module TwitterSearch
module Doubles
class JSONToCSVConverter
def initialize(attrs = {})
end
def process(input_data = [], add_headers = false, additional_fields = {})
input_data.join("\n")
end
def generate_headers(additional_fields = {})
if additional_fields.nil? || additional_fields.empty?
''
else
additional_fields.join(',')
end
end
end
end
end
end