cartodb-4.42/services/datasources/spec/doubles/json_to_csv_converter.rb

23 lines
504 B
Ruby
Raw Normal View History

2024-04-06 13:25:13 +08:00
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