Sha256: 182b8e86d239b187e359bef1ceec0e8ffc68988d551cd94ef1f917473f1def37

Contents?: true

Size: 612 Bytes

Versions: 1

Compression:

Stored size: 612 Bytes

Contents

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

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
ios_analytics_cli-1.0.0 lib/ios_analytics_cli/interactors/event.rb