class AppStoreConnect::Client::Options

Constants

DEFAULTS
ENV_REGEXP

Attributes

config[R]
env[R]
kwargs[R]

Public Class Methods

new(kwargs = {}) click to toggle source
Calls superclass method
# File lib/app_store_connect/client/options.rb, line 19
def initialize(kwargs = {})
  @kwargs = kwargs
  @config = build_config
  @env = build_env

  options = DEFAULTS.merge(@env.merge(@config.merge(kwargs)))

  super(options)
end

Private Instance Methods

build_config() click to toggle source
# File lib/app_store_connect/client/options.rb, line 31
def build_config
  AppStoreConnect.config.dup
end
build_env() click to toggle source
# File lib/app_store_connect/client/options.rb, line 35
def build_env
  {}.tap do |hash|
    ENV.each do |key, value|
      match = key.match(ENV_REGEXP)

      next unless match

      hash[match[:suffix].downcase.to_sym] = value
    end
  end
end