require 'tty-prompt' module Analytics module Interactor class Event # Returns all properties, from all events, which uses an enum as the value. def self.all_enum_properties(events) events .reject { |event| event['properties'].nil? } .flat_map { |event| event['properties'] } .reject { |property| property['values'].nil? } end def self.enum_properties_from_event(event) properties = event['properties'] return nil if properties.nil? properties.reject { |property| property['values'].nil? } end end end end