Class: AppStoreConnect::Client

Inherits:
Object
  • Object
show all
Defined in:
lib/app_store_connect/client.rb,
lib/app_store_connect/client/utils.rb,
lib/app_store_connect/client/options.rb,
lib/app_store_connect/client/registry.rb,
lib/app_store_connect/client/authorization.rb

Defined Under Namespace

Classes: Authorization, Options, Registry, Utils

Instance Method Summary collapse

Constructor Details

#initialize(**kwargs) ⇒ Client

Returns a new instance of Client.



14
15
16
17
18
# File 'lib/app_store_connect/client.rb', line 14

def initialize(**kwargs)
  @options = Options.new(kwargs)
  @authorization = Authorization.new(@options.slice(*Authorization::OPTIONS))
  @registry = Registry.new(@options.slice(*Registry::OPTIONS))
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(method_name, **kwargs) ⇒ Object



24
25
26
27
28
29
30
# File 'lib/app_store_connect/client.rb', line 24

def method_missing(method_name, **kwargs)
  super unless web_service_endpoint_aliases.include?(method_name)

  web_service_endpoint = web_service_endpoint_by(method_name)

  call(web_service_endpoint, **kwargs)
end

Instance Method Details

#inspectObject

:nocov:



33
34
35
# File 'lib/app_store_connect/client.rb', line 33

def inspect
  "#<#{self.class.name}:#{object_id}>"
end

#respond_to_missing?(method_name, include_private = false) ⇒ Boolean

Returns:

  • (Boolean)


20
21
22
# File 'lib/app_store_connect/client.rb', line 20

def respond_to_missing?(method_name, include_private = false)
  web_service_endpoint_aliases.include?(method_name) || super
end

#web_service_endpoint_aliasesObject

:nocov:



38
39
40
# File 'lib/app_store_connect/client.rb', line 38

def web_service_endpoint_aliases
  @registry.keys
end