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
10 11 12 |
# File 'lib/upkeep/subscriptions/store.rb', line 10 def graph @graph end |
#id ⇒ Object (readonly)
Returns the value of attribute id
10 11 12 |
# File 'lib/upkeep/subscriptions/store.rb', line 10 def id @id end |
#metadata ⇒ Object (readonly)
Returns the value of attribute metadata
10 11 12 |
# File 'lib/upkeep/subscriptions/store.rb', line 10 def @metadata end |
#recorder ⇒ Object (readonly)
Returns the value of attribute recorder
10 11 12 |
# File 'lib/upkeep/subscriptions/store.rb', line 10 def recorder @recorder end |
#subscriber_id ⇒ Object (readonly)
Returns the value of attribute subscriber_id
10 11 12 |
# File 'lib/upkeep/subscriptions/store.rb', line 10 def subscriber_id @subscriber_id end |
Class Method Details
.from_h(snapshot) ⇒ Object
37 38 39 40 41 42 43 44 45 46 47 48 |
# File 'lib/upkeep/subscriptions/store.rb', line 37 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
11 12 13 |
# File 'lib/upkeep/subscriptions/store.rb', line 11 def identity_signature(frame_id) recorder.identity_signature(frame_id) end |
#replay_recipe(frame_id) ⇒ Object
15 16 17 |
# File 'lib/upkeep/subscriptions/store.rb', line 15 def replay_recipe(frame_id) graph.node(frame_id).payload[:recipe] end |
#to_h ⇒ Object
19 20 21 22 23 24 25 26 |
# File 'lib/upkeep/subscriptions/store.rb', line 19 def to_h { id: id, subscriber_id: subscriber_id, recorder: recorder.to_h, metadata: } end |
#to_persistent_h ⇒ Object
28 29 30 31 32 33 34 35 |
# File 'lib/upkeep/subscriptions/store.rb', line 28 def to_persistent_h { id: id, subscriber_id: subscriber_id, recorder: recorder.to_persistent_h, metadata: } end |