Class: Mayu::State::ActionWrapper
- Inherits:
-
Object
- Object
- Mayu::State::ActionWrapper
- Extended by:
- T::Sig
- Defined in:
- lib/mayu/state/action_wrapper.rb
Instance Attribute Summary collapse
-
#payload ⇒ Object
readonly
Returns the value of attribute payload.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Instance Method Summary collapse
- #[](key) ⇒ Object
- #fetch(key, &block) ⇒ Object
-
#initialize(type:, payload:) ⇒ ActionWrapper
constructor
A new instance of ActionWrapper.
- #inspect ⇒ Object
Constructor Details
#initialize(type:, payload:) ⇒ ActionWrapper
Returns a new instance of ActionWrapper.
14 15 16 17 |
# File 'lib/mayu/state/action_wrapper.rb', line 14 def initialize(type:, payload:) @type = type @payload = payload end |
Instance Attribute Details
#payload ⇒ Object (readonly)
Returns the value of attribute payload.
11 12 13 |
# File 'lib/mayu/state/action_wrapper.rb', line 11 def payload @payload end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
9 10 11 |
# File 'lib/mayu/state/action_wrapper.rb', line 9 def type @type end |
Instance Method Details
#[](key) ⇒ Object
20 |
# File 'lib/mayu/state/action_wrapper.rb', line 20 def [](key) = @payload[key] |
#fetch(key, &block) ⇒ Object
22 |
# File 'lib/mayu/state/action_wrapper.rb', line 22 def fetch(key, &block) = @payload.fetch(key, &block) |
#inspect ⇒ Object
25 26 27 |
# File 'lib/mayu/state/action_wrapper.rb', line 25 def inspect "#<Action/#{type} payload=#{payload.inspect}>" end |