Class: Upkeep::Subscriptions::Subscription
- Inherits:
-
Data
- Object
- Data
- Upkeep::Subscriptions::Subscription
- Defined in:
- lib/upkeep/subscriptions/store.rb
Instance Attribute Summary collapse
-
#graph ⇒ Object
readonly
Returns the value of attribute graph.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#metadata ⇒ Object
readonly
Returns the value of attribute metadata.
-
#recorder ⇒ Object
readonly
Returns the value of attribute recorder.
-
#subscriber_id ⇒ Object
readonly
Returns the value of attribute subscriber_id.
Class Method Summary collapse
Instance Method Summary collapse
- #identity_signature(frame_id) ⇒ Object
- #replay_recipe(frame_id) ⇒ Object
- #to_h ⇒ Object
- #to_persistent_h ⇒ Object
Instance Attribute Details
#graph ⇒ Object (readonly)
Returns the value of attribute graph
8 9 10 |
# File 'lib/upkeep/subscriptions/store.rb', line 8 def graph @graph end |
#id ⇒ Object (readonly)
Returns the value of attribute id
8 9 10 |
# File 'lib/upkeep/subscriptions/store.rb', line 8 def id @id end |
#metadata ⇒ Object (readonly)
Returns the value of attribute metadata
8 9 10 |
# File 'lib/upkeep/subscriptions/store.rb', line 8 def @metadata end |
#recorder ⇒ Object (readonly)
Returns the value of attribute recorder
8 9 10 |
# File 'lib/upkeep/subscriptions/store.rb', line 8 def recorder @recorder end |
#subscriber_id ⇒ Object (readonly)
Returns the value of attribute subscriber_id
8 9 10 |
# File 'lib/upkeep/subscriptions/store.rb', line 8 def subscriber_id @subscriber_id end |
Class Method Details
.from_h(snapshot) ⇒ Object
35 36 37 38 39 40 41 42 43 44 45 46 |
# File 'lib/upkeep/subscriptions/store.rb', line 35 def self.from_h(snapshot) snapshot = Dependencies.symbolize_keys(snapshot) recorder = Runtime::Recorder.from_h(snapshot.fetch(:recorder)) new( snapshot.fetch(:id), snapshot.fetch(:subscriber_id), recorder, recorder.graph, snapshot.fetch(:metadata) ) end |
Instance Method Details
#identity_signature(frame_id) ⇒ Object
9 10 11 |
# File 'lib/upkeep/subscriptions/store.rb', line 9 def identity_signature(frame_id) recorder.identity_signature(frame_id) end |
#replay_recipe(frame_id) ⇒ Object
13 14 15 |
# File 'lib/upkeep/subscriptions/store.rb', line 13 def replay_recipe(frame_id) graph.node(frame_id).payload[:recipe] end |
#to_h ⇒ Object
17 18 19 20 21 22 23 24 |
# File 'lib/upkeep/subscriptions/store.rb', line 17 def to_h { id: id, subscriber_id: subscriber_id, recorder: recorder.to_h, metadata: } end |
#to_persistent_h ⇒ Object
26 27 28 29 30 31 32 33 |
# File 'lib/upkeep/subscriptions/store.rb', line 26 def to_persistent_h { id: id, subscriber_id: subscriber_id, recorder: recorder.to_persistent_h, metadata: } end |