Class: PgEventstore::SubscriptionsSet
- Inherits:
-
Object
- Object
- PgEventstore::SubscriptionsSet
- Includes:
- Extensions::OptionsExtension
- Defined in:
- lib/pg_eventstore/subscriptions/subscriptions_set.rb,
sig/pg_eventstore/subscriptions/subscriptions_set.rbs
Overview
Defines ruby's representation of subscriptions_set record.
Instance Attribute Summary collapse
- #created_at ⇒ Time?
-
#id ⇒ Integer?
It is used to lock the Subscription by updating Subscription#locked_by attribute.
-
#last_error ⇒ Hash?
The information about last error caused when pulling Subscriptions events.
-
#last_error_occurred_at ⇒ Time?
The time when the last error occurred.
-
#last_restarted_at ⇒ Time?
Last time the SubscriptionsSet was restarted.
-
#max_restarts_number ⇒ Integer?
Maximum number of times the SubscriptionsSet can be restarted.
-
#name ⇒ String?
Name of the set.
-
#restart_count ⇒ Integer?
The number of SubscriptionsSet's restarts after its failure.
- #state ⇒ String?
-
#time_between_restarts ⇒ Integer?
Interval in seconds between retries of failed SubscriptionsSet.
- #updated_at ⇒ Time?
Class Method Summary collapse
-
.create(attrs) ⇒ PgEventstore::SubscriptionsSet
@param
attrs.
Instance Method Summary collapse
-
#==(other) ⇒ Boolean
@param
another. -
#assign_attributes(attrs) ⇒ ::Hash[untyped, untyped]
@param
attrs. - #delete ⇒ void
-
#dup ⇒ PgEventstore::SubscriptionsSet
Dup the current object without assigned connection.
-
#eql?(other) ⇒ Boolean
@param
another. - #hash ⇒ Integer
-
#init_default_values ⇒ void
@param
options. -
#initialize ⇒ SubscriptionsSet
constructor
A new instance of SubscriptionsSet.
- #options_hash ⇒ ::Hash[untyped, untyped]
-
#readonly! ⇒ Boolean
@param
opt_name. -
#readonly? ⇒ Boolean
@param
opt_name. -
#readonly_error ⇒ void
@param
opt_name. - #reload ⇒ PgEventstore::SubscriptionsSet
- #subscriptions_set_queries ⇒ PgEventstore::SubscriptionsSetQueries
-
#update(attrs) ⇒ ::Hash[untyped, untyped]
@param
attrs.
Methods included from Extensions::OptionsExtension
Constructor Details
#initialize ⇒ SubscriptionsSet
Returns a new instance of SubscriptionsSet.
34 |
# File 'sig/pg_eventstore/subscriptions/subscriptions_set.rbs', line 34
def initialize: (**untyped options) -> void
|
Instance Attribute Details
#created_at ⇒ Time?
54 |
# File 'lib/pg_eventstore/subscriptions/subscriptions_set.rb', line 54 attribute(:created_at) |
#id ⇒ Integer?
Returns It is used to lock the Subscription by updating Subscription#locked_by attribute.
26 |
# File 'lib/pg_eventstore/subscriptions/subscriptions_set.rb', line 26 attribute(:id) |
#last_error ⇒ Hash?
Returns the information about last error caused when pulling Subscriptions events.
48 |
# File 'lib/pg_eventstore/subscriptions/subscriptions_set.rb', line 48 attribute(:last_error) |
#last_error_occurred_at ⇒ Time?
Returns the time when the last error occurred.
51 |
# File 'lib/pg_eventstore/subscriptions/subscriptions_set.rb', line 51 attribute(:last_error_occurred_at) |
#last_restarted_at ⇒ Time?
Returns last time the SubscriptionsSet was restarted.
44 |
# File 'lib/pg_eventstore/subscriptions/subscriptions_set.rb', line 44 attribute(:last_restarted_at) |
#max_restarts_number ⇒ Integer?
Returns maximum number of times the SubscriptionsSet can be restarted.
38 |
# File 'lib/pg_eventstore/subscriptions/subscriptions_set.rb', line 38 attribute(:max_restarts_number) |
#name ⇒ String?
Returns name of the set.
29 |
# File 'lib/pg_eventstore/subscriptions/subscriptions_set.rb', line 29 attribute(:name) |
#restart_count ⇒ Integer?
Returns the number of SubscriptionsSet's restarts after its failure.
35 |
# File 'lib/pg_eventstore/subscriptions/subscriptions_set.rb', line 35 attribute(:restart_count) |
#state ⇒ String?
32 |
# File 'lib/pg_eventstore/subscriptions/subscriptions_set.rb', line 32 attribute(:state) |
#time_between_restarts ⇒ Integer?
Returns interval in seconds between retries of failed SubscriptionsSet.
41 |
# File 'lib/pg_eventstore/subscriptions/subscriptions_set.rb', line 41 attribute(:time_between_restarts) |
#updated_at ⇒ Time?
57 |
# File 'lib/pg_eventstore/subscriptions/subscriptions_set.rb', line 57 attribute(:updated_at) |
Class Method Details
.create(attrs) ⇒ PgEventstore::SubscriptionsSet
@param attrs
12 13 14 |
# File 'lib/pg_eventstore/subscriptions/subscriptions_set.rb', line 12 def create(attrs) new(**subscriptions_set_queries.create(attrs)) end |
Instance Method Details
#==(other) ⇒ Boolean
@param another
105 106 107 108 109 |
# File 'lib/pg_eventstore/subscriptions/subscriptions_set.rb', line 105 def ==(other) return false unless other.is_a?(SubscriptionsSet) id == other.id end |
#assign_attributes(attrs) ⇒ ::Hash[untyped, untyped]
@param attrs
61 62 63 64 65 |
# File 'lib/pg_eventstore/subscriptions/subscriptions_set.rb', line 61 def assign_attributes(attrs) attrs.each do |attr, value| public_send("#{attr}=", value) end end |
#delete ⇒ void
This method returns an undefined value.
74 75 76 |
# File 'lib/pg_eventstore/subscriptions/subscriptions_set.rb', line 74 def delete subscriptions_set_queries.delete(id) end |
#dup ⇒ PgEventstore::SubscriptionsSet
Dup the current object without assigned connection
80 81 82 |
# File 'lib/pg_eventstore/subscriptions/subscriptions_set.rb', line 80 def dup SubscriptionsSet.new(**Utils.deep_dup()) end |
#eql?(other) ⇒ Boolean
@param another
97 98 99 100 101 |
# File 'lib/pg_eventstore/subscriptions/subscriptions_set.rb', line 97 def eql?(other) return false unless other.is_a?(SubscriptionsSet) hash == other.hash end |
#hash ⇒ Integer
91 92 93 |
# File 'lib/pg_eventstore/subscriptions/subscriptions_set.rb', line 91 def hash id.hash end |
#init_default_values ⇒ void
This method returns an undefined value.
@param options
48 |
# File 'sig/pg_eventstore/subscriptions/subscriptions_set.rbs', line 48
def init_default_values: (::Hash[untyped, untyped] options) -> void
|
#options_hash ⇒ ::Hash[untyped, untyped]
36 |
# File 'sig/pg_eventstore/subscriptions/subscriptions_set.rbs', line 36
def options_hash: () -> ::Hash[untyped, untyped]
|
#readonly! ⇒ Boolean
@param opt_name
39 |
# File 'sig/pg_eventstore/subscriptions/subscriptions_set.rbs', line 39
def readonly!: (Symbol opt_name) -> bool
|
#readonly? ⇒ Boolean
@param opt_name
42 |
# File 'sig/pg_eventstore/subscriptions/subscriptions_set.rbs', line 42
def readonly?: (Symbol opt_name) -> bool
|
#readonly_error ⇒ void
This method returns an undefined value.
@param opt_name
45 |
# File 'sig/pg_eventstore/subscriptions/subscriptions_set.rbs', line 45
def readonly_error: (Symbol opt_name) -> void
|
#reload ⇒ PgEventstore::SubscriptionsSet
85 86 87 88 |
# File 'lib/pg_eventstore/subscriptions/subscriptions_set.rb', line 85 def reload assign_attributes(subscriptions_set_queries.find!(id)) self end |
#subscriptions_set_queries ⇒ PgEventstore::SubscriptionsSetQueries
114 115 116 |
# File 'lib/pg_eventstore/subscriptions/subscriptions_set.rb', line 114 def subscriptions_set_queries SubscriptionsSetQueries.new(self.class.connection) end |
#update(attrs) ⇒ ::Hash[untyped, untyped]
@param attrs
69 70 71 |
# File 'lib/pg_eventstore/subscriptions/subscriptions_set.rb', line 69 def update(attrs) assign_attributes(subscriptions_set_queries.update(id, attrs)) end |