Sha256: 39fd893f33ae66c794f41f571dba10f6172f4db69c3f449861be5a079a120dc4

Contents?: true

Size: 653 Bytes

Versions: 8

Compression:

Stored size: 653 Bytes

Contents

import Foundation

public enum AnalyticsEvent {
    <%- for @event in @events -%>
    case .<%= @event.name %>
    <%- end -%>

    public var name: String {
        switch self {
        <%- for @event in @events -%>
        case .<%= @event.name %>: return "<%= @event.name %>"
        <%- end -%>
        }
    }

    public var params: [String:String]? {
        switch self {
        <%- for @event in @events -%>
        <%- if @event.params.nil? -%>
        case .<%= @event.name %>: return nil
        <%- else -%>
        case .<%= @event.name %>: return <%= @event.params_for(:ios) %>
        <%- end -%>
        <%- end -%>
        }
    }
}

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
ai_tagger-0.1.7 lib/templates/AnalyticsEvent.swift.erb
ai_tagger-0.1.6 lib/templates/AnalyticsEvent.swift.erb
ai_tagger-0.1.5 lib/templates/AnalyticsEvent.swift.erb
ai_tagger-0.1.4 lib/templates/AnalyticsEvent.swift.erb
ai_tagger-0.1.3 data/templates/AnalyticsEvent.swift.erb
ai_tagger-0.1.2 data/templates/AnalyticsEvent.swift.erb
ai_tagger-0.1.1 data/templates/AnalyticsEvent.swift.erb
ai_tagger-0.1.0 data/templates/AnalyticsEvent.swift.erb