Sha256: 80daa75ffe1ba4c45281b91f899e8b909d358cbd0f43a4392d69eac3524e90ff
Contents?: true
Size: 861 Bytes
Versions: 13
Compression:
Stored size: 861 Bytes
Contents
module Tagger class Generator attr_accessor :events, :platform def initialize(events, platform) @events = events @platform = platform end def generate(output_location) File.write("#{output_location}/#{output_file_name}", output) end private def template File.open(template_file, "r").read end def output_file_name case @platform when :ios "AnalyticsEvent.swift" when :android "AnalyticsEvent.kt" end end def template_file case @platform when :ios "#{Tagger.root}/lib/templates/AnalyticsEvent.swift.erb" when :android "#{Tagger.root}/lib/templates/AnalyticsEvent.kt.erb" end end def renderer ERB.new(template, nil, '-') end def output renderer.result(binding) end end end
Version data entries
13 entries across 13 versions & 1 rubygems