Class: PM::MapRelations

Inherits:
Object
  • Object
show all
Defined in:
lib/cocoapods-byte-panglem-beta/config.rb

Overview

adn mediation adapter 三者之间的映射关系, mediation后续会用到

Constant Summary collapse

ADNADAPTER =
Hash[
  ## sdk 不需要
  # 'Ads-CN' => 'ABUAdCsjAdapter',
  'UnityAds' => 'ABUAdUnityAdapter',
  'Google-Mobile-Ads-SDK'=> 'ABUAdAdmobAdapter',
  'BaiduMobAdSDK'=> 'ABUAdBaiduAdapter',
  'GDTMobSDK'=> 'ABUAdGdtAdapter',
  'SigmobAd-iOS'=> 'ABUAdSigmobAdapter',
  'KSAdSDK'=> 'ABUAdKsAdapter',
  'KlevinAdSDK'=> 'ABUAdKlevinAdapter',
  'MintegralAdSDK'=> 'ABUAdMintegralAdapter',
].freeze
SERVERMAPADAPTER =

sdk 被接入adapter的映射关系

Hash[

  'GoogleMobileAdsMediationPangle'=> 'admob',
  'IronSourcePangleAdapter'=> 'ironsource',
  'AppLovinMediationByteDanceAdapter'=> 'max',
  'TradPlusAdSDK/PangleAdapter'=> 'tradplus',
  'AnyThinkiOS/AnyThinkPangleAdapter'=> 'topon',
].freeze
SERVERMAPADN =
Hash[
  'UnityAds' => 'unity',
  'Google-Mobile-Ads-SDK'=> 'admob',
  'BaiduMobAdSDK'=> 'baidu',
  'GDTMobSDK'=> 'gdt',
  'SigmobAd-iOS'=> 'sigmob',
  'KSAdSDK'=> 'ks',
  'KlevinAdSDK'=> 'klevin',
  'MintegralAdSDK'=> 'mtg',
].freeze
SDKNAME =
"Ads-Global-Beta".freeze
SDKRELY =
"BURelyFoundation_Global".freeze
SHOULD_REMOVE =
[SDKNAME,SDKRELY]

Class Method Summary collapse

Class Method Details

.get_adapter(name) ⇒ Object



139
140
141
142
143
144
145
# File 'lib/cocoapods-byte-panglem-beta/config.rb', line 139

def self.get_adapter(name)
  adapter = ''
  if is_adn?(name)
    adapter = ADNADAPTER[name]
  end
  adapter
end

.get_adapter_from_adn_abbreviation(name) ⇒ Object



119
120
121
# File 'lib/cocoapods-byte-panglem-beta/config.rb', line 119

def self.get_adapter_from_adn_abbreviation(name)
  SERVERMAPADAPTER[name]
end

.get_adn(name) ⇒ Object



147
148
149
150
151
152
153
154
155
156
157
158
159
160
# File 'lib/cocoapods-byte-panglem-beta/config.rb', line 147

def self.get_adn(name)
  adn_name = ''
  if is_adapter?(name)
    ## .index 在调试时候会报错
    ADNADAPTER.select{ |key, value|
    if value == name
      adn_name = key
      break
    end
    true
    }
  end
  adn_name
end

.get_adn_abbreviation(name) ⇒ Object



115
116
117
# File 'lib/cocoapods-byte-panglem-beta/config.rb', line 115

def self.get_adn_abbreviation(name)
  SERVERMAPADN[name]
end

.get_all_adapterObject



162
163
164
# File 'lib/cocoapods-byte-panglem-beta/config.rb', line 162

def self.get_all_adapter
  ADNADAPTER.values
end

.get_all_adnObject



166
167
168
# File 'lib/cocoapods-byte-panglem-beta/config.rb', line 166

def self.get_all_adn
  ADNADAPTER.keys
end

.get_sdkObject



170
171
172
# File 'lib/cocoapods-byte-panglem-beta/config.rb', line 170

def self.get_sdk
  SDKNAME
end

.is_adapter?(name) ⇒ Boolean

Returns:

  • (Boolean)


131
132
133
# File 'lib/cocoapods-byte-panglem-beta/config.rb', line 131

def self.is_adapter?(name)
  SERVERMAPADAPTER.has_key?(name)
end

.is_adn?(name) ⇒ Boolean

Returns:

  • (Boolean)


111
112
113
# File 'lib/cocoapods-byte-panglem-beta/config.rb', line 111

def self.is_adn?(name)
  name == SDKNAME
end

.is_sdk?(name) ⇒ Boolean

Returns:

  • (Boolean)


127
128
129
# File 'lib/cocoapods-byte-panglem-beta/config.rb', line 127

def self.is_sdk?(name)
  SDKNAME==name
end

.should_remove_requirements?(name) ⇒ Boolean

Returns:

  • (Boolean)


135
136
137
# File 'lib/cocoapods-byte-panglem-beta/config.rb', line 135

def self.should_remove_requirements?(name)
  SHOULD_REMOVE.include?(name)
end