Class: Igniter::Extensions::Contracts::Reactive::Subscription
- Inherits:
-
Object
- Object
- Igniter::Extensions::Contracts::Reactive::Subscription
- Defined in:
- lib/igniter/extensions/contracts/reactive/subscription.rb
Instance Attribute Summary collapse
-
#action ⇒ Object
readonly
Returns the value of attribute action.
-
#event_type ⇒ Object
readonly
Returns the value of attribute event_type.
-
#once_per_dispatch ⇒ Object
readonly
Returns the value of attribute once_per_dispatch.
-
#path ⇒ Object
readonly
Returns the value of attribute path.
Instance Method Summary collapse
-
#initialize(event_type:, action:, path: nil, once_per_dispatch: false) ⇒ Subscription
constructor
A new instance of Subscription.
- #to_h ⇒ Object
Constructor Details
#initialize(event_type:, action:, path: nil, once_per_dispatch: false) ⇒ Subscription
Returns a new instance of Subscription.
10 11 12 13 14 15 16 |
# File 'lib/igniter/extensions/contracts/reactive/subscription.rb', line 10 def initialize(event_type:, action:, path: nil, once_per_dispatch: false) @event_type = event_type.to_sym @path = path&.to_sym @action = action @once_per_dispatch = once_per_dispatch freeze end |
Instance Attribute Details
#action ⇒ Object (readonly)
Returns the value of attribute action.
8 9 10 |
# File 'lib/igniter/extensions/contracts/reactive/subscription.rb', line 8 def action @action end |
#event_type ⇒ Object (readonly)
Returns the value of attribute event_type.
8 9 10 |
# File 'lib/igniter/extensions/contracts/reactive/subscription.rb', line 8 def event_type @event_type end |
#once_per_dispatch ⇒ Object (readonly)
Returns the value of attribute once_per_dispatch.
8 9 10 |
# File 'lib/igniter/extensions/contracts/reactive/subscription.rb', line 8 def once_per_dispatch @once_per_dispatch end |
#path ⇒ Object (readonly)
Returns the value of attribute path.
8 9 10 |
# File 'lib/igniter/extensions/contracts/reactive/subscription.rb', line 8 def path @path end |
Instance Method Details
#to_h ⇒ Object
18 19 20 21 22 23 24 |
# File 'lib/igniter/extensions/contracts/reactive/subscription.rb', line 18 def to_h { event_type: event_type, path: path, once_per_dispatch: once_per_dispatch } end |