Class: Torikago::Invocation
- Inherits:
-
Object
- Object
- Torikago::Invocation
- Defined in:
- lib/torikago/invocation.rb,
sig/torikago.rbs
Overview
Describes one package API invocation without resolving or booting its Box.
Instance Attribute Summary collapse
-
#constructor_args ⇒ Array[untyped]
readonly
Returns the value of attribute constructor_args.
-
#constructor_kwargs ⇒ Hash[Symbol, untyped]
readonly
Returns the value of attribute constructor_kwargs.
-
#gateway ⇒ Gateway
readonly
Returns the value of attribute gateway.
-
#public_api_class_name ⇒ String
readonly
Returns the value of attribute public_api_class_name.
Instance Method Summary collapse
-
#initialize(gateway:, public_api_class_name:, constructor_args:, constructor_kwargs:) ⇒ Invocation
constructor
A new instance of Invocation.
- #invoke(method_name, *method_args, **method_kwargs) ⇒ Object
Constructor Details
#initialize(gateway:, public_api_class_name:, constructor_args:, constructor_kwargs:) ⇒ Invocation
Returns a new instance of Invocation.
4 5 6 7 8 9 |
# File 'lib/torikago/invocation.rb', line 4 def initialize(gateway:, public_api_class_name:, constructor_args:, constructor_kwargs:) @gateway = gateway @public_api_class_name = public_api_class_name @constructor_args = constructor_args.freeze @constructor_kwargs = constructor_kwargs.freeze end |
Instance Attribute Details
#constructor_args ⇒ Array[untyped] (readonly)
Returns the value of attribute constructor_args.
24 25 26 |
# File 'lib/torikago/invocation.rb', line 24 def constructor_args @constructor_args end |
#constructor_kwargs ⇒ Hash[Symbol, untyped] (readonly)
Returns the value of attribute constructor_kwargs.
24 25 26 |
# File 'lib/torikago/invocation.rb', line 24 def constructor_kwargs @constructor_kwargs end |
#gateway ⇒ Gateway (readonly)
Returns the value of attribute gateway.
24 25 26 |
# File 'lib/torikago/invocation.rb', line 24 def gateway @gateway end |
#public_api_class_name ⇒ String (readonly)
Returns the value of attribute public_api_class_name.
24 25 26 |
# File 'lib/torikago/invocation.rb', line 24 def public_api_class_name @public_api_class_name end |
Instance Method Details
#invoke(method_name, *method_args, **method_kwargs) ⇒ Object
11 12 13 14 15 16 17 18 19 20 |
# File 'lib/torikago/invocation.rb', line 11 def invoke(method_name, *method_args, **method_kwargs) gateway.dispatch( public_api_class_name: public_api_class_name, method_name: method_name, constructor_args: constructor_args, constructor_kwargs: constructor_kwargs, method_args: method_args, method_kwargs: method_kwargs ) end |