Class: DataDuck::Optimizely::Experiments

Inherits:
OptimizelyTable show all
Defined in:
lib/integrations/optimizely/experiments.rb

Instance Attribute Summary

Attributes inherited from Table

#data, #errors

Instance Method Summary collapse

Methods inherited from OptimizelyTable

#optimizely_api_token, #prefix

Methods inherited from Table

#actions, #autogenerate_identity?, #batch_size, #building_name, #check_table_valid!, #create_column_names, #create_schema, #distribution_key, #distribution_style, #etl!, #extract_by_clause, #extract_by_column, #extract_query, #identify_by_columns, #include_with_all?, #limit_clause, #load!, #name, output, #output_column_names, #output_schema, #postprocess!, #prefix, #recreate!, #show, source, #staging_name, #transform!, transforms, validates

Constructor Details

#initialize(experiments) ⇒ Experiments

Returns a new instance of Experiments.



13
14
15
# File 'lib/integrations/optimizely/experiments.rb', line 13

def initialize(experiments)
  self.data = experiments
end

Instance Method Details

#extract!(*args) ⇒ Object



17
18
19
# File 'lib/integrations/optimizely/experiments.rb', line 17

def extract!(*args)
  # already initialized data
end

#indexesObject



37
38
39
# File 'lib/integrations/optimizely/experiments.rb', line 37

def indexes
  ["id", "project_id", "primary_goal_id", "name"]
end

#percentage_included_to_float(row) ⇒ Object



27
28
29
30
31
# File 'lib/integrations/optimizely/experiments.rb', line 27

def percentage_included_to_float(row)
  row['percentage_included'] = row['percentage_included'].to_i / 100.0

  row
end

#rename_description_to_name(row) ⇒ Object



21
22
23
24
25
# File 'lib/integrations/optimizely/experiments.rb', line 21

def rename_description_to_name(row)
  row[:name] = row['description']

  row
end

#should_fully_reload?Boolean

Returns:

  • (Boolean)


33
34
35
# File 'lib/integrations/optimizely/experiments.rb', line 33

def should_fully_reload?
  true
end