Class: Mayu::State::ActionCreator::Base
- Inherits:
-
Object
- Object
- Mayu::State::ActionCreator::Base
- Extended by:
- T::Sig
- Defined in:
- lib/mayu/state/action_creator.rb
Direct Known Subclasses
AsyncActionCreator, PreparedActionCreator, StaticActionCreator
Instance Attribute Summary collapse
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Instance Method Summary collapse
- #===(other) ⇒ Object
- #call(payload = nil) ⇒ Object
-
#initialize(type) ⇒ Base
constructor
A new instance of Base.
Constructor Details
#initialize(type) ⇒ Base
Returns a new instance of Base.
18 19 20 |
# File 'lib/mayu/state/action_creator.rb', line 18 def initialize(type) @type = type end |
Instance Attribute Details
#type ⇒ Object (readonly)
Returns the value of attribute type.
15 16 17 |
# File 'lib/mayu/state/action_creator.rb', line 15 def type @type end |
Instance Method Details
#===(other) ⇒ Object
32 33 34 35 36 37 38 39 40 41 |
# File 'lib/mayu/state/action_creator.rb', line 32 def ===(other) case other when Hash @type == other[:type] when ActionWrapper @type == other.type else super end end |
#call(payload = nil) ⇒ Object
27 28 29 |
# File 'lib/mayu/state/action_creator.rb', line 27 def call(payload = nil) { type:, payload: } end |