Class: Mayu::State::ActionCreator::PreparedActionCreator
- Defined in:
- lib/mayu/state/action_creator.rb
Constant Summary collapse
- ProcType =
T.type_alias { T.proc.returns(Store::ActionHash) }
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
- #call(*args, **kwargs) ⇒ Object
-
#initialize(type, &block) ⇒ PreparedActionCreator
constructor
A new instance of PreparedActionCreator.
Methods inherited from Base
Constructor Details
#initialize(type, &block) ⇒ PreparedActionCreator
53 54 55 56 |
# File 'lib/mayu/state/action_creator.rb', line 53 def initialize(type, &block) super(type) @prepare = block end |
Instance Method Details
#call(*args, **kwargs) ⇒ Object
61 62 63 |
# File 'lib/mayu/state/action_creator.rb', line 61 def call(*args, **kwargs) { type: }.merge(T.unsafe(@prepare).call(*args, **kwargs)) end |