Class: CandyCheck::PlayStore::Config

Inherits:
Utils::Config show all
Defined in:
lib/candy_check/play_store/config.rb

Overview

Configure the usage of the official Google API SDK client

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes) ⇒ Config

Initializes a new configuration from a hash

Examples:

Initialize with a discovery cache file

ClientConfig.new(
  application_name: 'YourApplication',
  application_version: '1.0',
  cache_file: 'tmp/google_api_cache',
  issuer: '[email protected]',
  key_file: 'local/google.p12',
  key_secret: 'notasecret'
)


29
30
31
# File 'lib/candy_check/play_store/config.rb', line 29

def initialize(attributes)
  super
end

Instance Attribute Details

#application_nameString (readonly)



6
7
8
# File 'lib/candy_check/play_store/config.rb', line 6

def application_name
  @application_name
end

#application_versionString (readonly)



8
9
10
# File 'lib/candy_check/play_store/config.rb', line 8

def application_version
  @application_version
end

#cache_fileString (readonly)



10
11
12
# File 'lib/candy_check/play_store/config.rb', line 10

def cache_file
  @cache_file
end

#issuerString (readonly)



12
13
14
# File 'lib/candy_check/play_store/config.rb', line 12

def issuer
  @issuer
end

#key_fileString (readonly)



14
15
16
# File 'lib/candy_check/play_store/config.rb', line 14

def key_file
  @key_file
end

#key_secretString (readonly)



16
17
18
# File 'lib/candy_check/play_store/config.rb', line 16

def key_secret
  @key_secret
end

Instance Method Details

#api_keyString



34
35
36
37
38
# File 'lib/candy_check/play_store/config.rb', line 34

def api_key
  @api_key ||= begin
    Google::APIClient::KeyUtils.load_from_pkcs12(key_file, key_secret)
  end
end