Class: Hecks::Router::NamespaceInstaller::OptionsProxy
- Inherits:
-
Object
- Object
- Hecks::Router::NamespaceInstaller::OptionsProxy
- Defined in:
- lib/hecks/router/namespace_installer.rb
Instance Method Summary collapse
-
#initialize(router:, realm:, domain:, aggregate:, options:) ⇒ OptionsProxy
constructor
A new instance of OptionsProxy.
- #method_missing(verb, **args) ⇒ Object
- #respond_to_missing?(verb, include_private = false) ⇒ Boolean
Constructor Details
#initialize(router:, realm:, domain:, aggregate:, options:) ⇒ OptionsProxy
Returns a new instance of OptionsProxy.
11 12 13 14 15 16 17 |
# File 'lib/hecks/router/namespace_installer.rb', line 11 def initialize(router:, realm:, domain:, aggregate:, options:) unknown = .keys - [:version] raise ArgumentError, "unknown router options: #{unknown.join(', ')}" unless unknown.empty? @router, @realm, @domain, @aggregate = router, realm, domain, aggregate @version = [:version]&.to_s end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(verb, **args) ⇒ Object
19 20 21 22 |
# File 'lib/hecks/router/namespace_installer.rb', line 19 def method_missing(verb, **args) fqn = fqn_for(verb) fqn.command? ? @router.dispatch(fqn.to_s, **args) : @router.query(fqn.to_s, **args) end |
Instance Method Details
#respond_to_missing?(verb, include_private = false) ⇒ Boolean
24 25 26 |
# File 'lib/hecks/router/namespace_installer.rb', line 24 def respond_to_missing?(verb, include_private = false) Fqn.command_name?(verb) || Fqn.query_name?(verb) || super end |