Class: PgNotifier::Subscription
- Inherits:
-
Object
- Object
- PgNotifier::Subscription
- Defined in:
- lib/pg_notifier/subscription.rb
Instance Attribute Summary collapse
-
#block ⇒ Object
readonly
Returns the value of attribute block.
-
#channel ⇒ Object
readonly
Returns the value of attribute channel.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
Instance Method Summary collapse
-
#initialize(channel, options, &block) ⇒ Subscription
constructor
A new instance of Subscription.
- #notify(channel, pid, payload) ⇒ Object
Constructor Details
#initialize(channel, options, &block) ⇒ Subscription
Returns a new instance of Subscription.
5 6 7 8 9 |
# File 'lib/pg_notifier/subscription.rb', line 5 def initialize(channel, , &block) @channel = channel @options = @block = block end |
Instance Attribute Details
#block ⇒ Object (readonly)
Returns the value of attribute block.
3 4 5 |
# File 'lib/pg_notifier/subscription.rb', line 3 def block @block end |
#channel ⇒ Object (readonly)
Returns the value of attribute channel.
3 4 5 |
# File 'lib/pg_notifier/subscription.rb', line 3 def channel @channel end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
3 4 5 |
# File 'lib/pg_notifier/subscription.rb', line 3 def @options end |
Instance Method Details
#notify(channel, pid, payload) ⇒ Object
11 12 13 |
# File 'lib/pg_notifier/subscription.rb', line 11 def notify(channel, pid, payload) block.call [channel, pid, payload] end |