Class: Analytics::Serializer::ObjC::AnalyticsFile

Inherits:
Object
  • Object
show all
Defined in:
lib/ios_analytics_cli/serializers/objc/analytics.rb

Overview

It’s named AnalyticsFile instead of Analytics, because it failed to have a class which used the same name as the parent module.

Instance Method Summary collapse

Constructor Details

#initialize(src) ⇒ AnalyticsFile

Returns a new instance of AnalyticsFile.



9
10
11
# File 'lib/ios_analytics_cli/serializers/objc/analytics.rb', line 9

def initialize(src)
  @src = src
end

Instance Method Details

#save(path) ⇒ Object



13
14
15
16
17
18
19
20
21
22
23
# File 'lib/ios_analytics_cli/serializers/objc/analytics.rb', line 13

def save(path)
  @class_name = 'Analytics'

  @file_name = @class_name + '.h'
  output_path = File.join(path, @file_name)
  File.write(output_path, render_h)

  @file_name = @class_name + '.m'
  output_path = File.join(path, @file_name)
  File.write(output_path, render_m)
end