Class: AppStoreDevApi::Base
- Inherits:
-
Object
- Object
- AppStoreDevApi::Base
- Defined in:
- lib/app_store_dev_api/base.rb
Direct Known Subclasses
Instance Method Summary collapse
-
#initialize(**kwargs) ⇒ Base
constructor
A new instance of Base.
-
#inspect ⇒ Object
:nocov:.
- #method_missing(method_name, **kwargs) ⇒ Object
- #respond_to_missing?(method_name, include_private = false) ⇒ Boolean
-
#web_service_endpoint_aliases ⇒ Object
:nocov:.
Constructor Details
#initialize(**kwargs) ⇒ Base
Returns a new instance of Base.
5 6 7 8 9 |
# File 'lib/app_store_dev_api/base.rb', line 5 def initialize(**kwargs) @options = Client::Options.new(kwargs) @authorization = Client::Authorization.new(@options.slice(*Client::Authorization::OPTIONS)) @registry = Client::Registry.new(@options.slice(*Client::Registry::OPTIONS)) end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(method_name, **kwargs) ⇒ Object
15 16 17 18 19 20 21 |
# File 'lib/app_store_dev_api/base.rb', line 15 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
#inspect ⇒ Object
:nocov:
24 25 26 |
# File 'lib/app_store_dev_api/base.rb', line 24 def inspect "#<#{self.class.name}:#{object_id}>" end |
#respond_to_missing?(method_name, include_private = false) ⇒ Boolean
11 12 13 |
# File 'lib/app_store_dev_api/base.rb', line 11 def respond_to_missing?(method_name, include_private = false) web_service_endpoint_aliases.include?(method_name) || super end |
#web_service_endpoint_aliases ⇒ Object
:nocov:
29 30 31 |
# File 'lib/app_store_dev_api/base.rb', line 29 def web_service_endpoint_aliases @registry.keys end |