Class: HookSniff::StreamApi
- Inherits:
-
Object
- Object
- HookSniff::StreamApi
- Defined in:
- lib/hooksniff/api/stream.rb
Instance Method Summary collapse
- #create_channel(attrs) ⇒ Object
- #delete_channel(id) ⇒ Object
- #disconnect_subscription(id) ⇒ Object
- #get_channel(id) ⇒ Object
-
#initialize(client) ⇒ StreamApi
constructor
A new instance of StreamApi.
- #list_channels ⇒ Object
- #list_messages(id, params = {}) ⇒ Object
- #list_subscriptions ⇒ Object
- #publish(body) ⇒ Object
- #update_channel(id, attrs) ⇒ Object
Constructor Details
#initialize(client) ⇒ StreamApi
Returns a new instance of StreamApi.
5 6 7 |
# File 'lib/hooksniff/api/stream.rb', line 5 def initialize(client) @client = client end |
Instance Method Details
#create_channel(attrs) ⇒ Object
17 18 19 |
# File 'lib/hooksniff/api/stream.rb', line 17 def create_channel(attrs) @client.request(:post, "/v1/stream/channels", attrs) end |
#delete_channel(id) ⇒ Object
25 26 27 |
# File 'lib/hooksniff/api/stream.rb', line 25 def delete_channel(id) @client.request(:delete, "/v1/stream/channels/#{id}") end |
#disconnect_subscription(id) ⇒ Object
37 38 39 |
# File 'lib/hooksniff/api/stream.rb', line 37 def disconnect_subscription(id) @client.request(:delete, "/v1/stream/subscriptions/#{id}") end |
#get_channel(id) ⇒ Object
13 14 15 |
# File 'lib/hooksniff/api/stream.rb', line 13 def get_channel(id) @client.request(:get, "/v1/stream/channels/#{id}") end |
#list_channels ⇒ Object
9 10 11 |
# File 'lib/hooksniff/api/stream.rb', line 9 def list_channels @client.request(:get, "/v1/stream/channels") end |
#list_messages(id, params = {}) ⇒ Object
29 30 31 |
# File 'lib/hooksniff/api/stream.rb', line 29 def (id, params = {}) @client.request(:get, "/v1/stream/channels/#{id}/messages", params) end |
#list_subscriptions ⇒ Object
33 34 35 |
# File 'lib/hooksniff/api/stream.rb', line 33 def list_subscriptions @client.request(:get, "/v1/stream/subscriptions") end |
#publish(body) ⇒ Object
41 42 43 |
# File 'lib/hooksniff/api/stream.rb', line 41 def publish(body) @client.request(:post, "/v1/stream/publish", body) end |
#update_channel(id, attrs) ⇒ Object
21 22 23 |
# File 'lib/hooksniff/api/stream.rb', line 21 def update_channel(id, attrs) @client.request(:put, "/v1/stream/channels/#{id}", attrs) end |