Class: Flow::Cli::ProjectAnalytics

Inherits:
Object
  • Object
show all
Defined in:
lib/flow/cli/project_analytics.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(config = {}) ⇒ ProjectAnalytics

Returns a new instance of ProjectAnalytics.



4
5
6
7
8
# File 'lib/flow/cli/project_analytics.rb', line 4

def initialize(config = {})
  # 要 env
  config[:flow_language] = language
  self.config = config
end

Instance Attribute Details

#configObject

Returns the value of attribute config.



3
4
5
# File 'lib/flow/cli/project_analytics.rb', line 3

def config
  @config
end

Instance Method Details

#languageObject



10
11
12
13
14
15
16
17
# File 'lib/flow/cli/project_analytics.rb', line 10

def language
  case platform
  when "ios"
    "objc"
  when "android"
    "android"
  end
end

#platformObject



19
20
21
22
23
24
# File 'lib/flow/cli/project_analytics.rb', line 19

def platform
  raise ConflictPlatformError, "conflict platforms" if ios? && android?
  return "ios" if ios?
  return "android" if android?
  raise ConflictPlatformError, "conflict, unknown platform"
end