Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Ruby based ETL pipeline with Iron.io and Redshift
# lib/transformers/mixpanel/app_launched_event.rb
module Transformers
module Mixpanel
class AppLaunchEvent
def initialize(data)
@data = data
end
def csv_row
CSV.generate_line(ordinal_transformed_data)
end
private
def ordinal_transformed_data
# transformed data in ordinal column position
[
data['customer_id'],
device_id,
device_platform,
data['timestamp'],
# ...
]
end
def device_id
# Transformation of device identifier
end
def device_platform
# Transformation of device platform
end
attr_reader :data
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.