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.



6
7
8
9
10
# File 'lib/flow/cli/project_analytics.rb', line 6

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

Instance Attribute Details

#configObject

Returns the value of attribute config.



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

def config
  @config
end

Instance Method Details

#languageObject



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

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

#platformObject



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

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