Class: Demux::Connection

Inherits:
ApplicationRecord show all
Defined in:
app/models/demux/connection.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.listening_for(signal_name:, account_id:) ⇒ Object


8
9
10
11
12
# File 'app/models/demux/connection.rb', line 8

def listening_for(signal_name:, account_id:)
  where(account_id: )
    .signal(signal_name)
    .or(wildcard_signal)
end

.signal(signal) ⇒ Object


14
15
16
# File 'app/models/demux/connection.rb', line 14

def signal(signal)
  where("demux_connections.signals @> ?", "{#{signal}}")
end

Instance Method Details

#entry_urlString

Return an entry url for this specific connection

Returns:

  • (String)

    the entry url with account_id in signed token


29
30
31
# File 'app/models/demux/connection.rb', line 29

def entry_url
  app.signed_entry_url(data: { account_id:  })
end