class Finnhub::Webhook
Attributes
hash[R]
id[R]
Public Class Methods
new(client:, id: nil, hash: nil)
click to toggle source
# File lib/Webhook.rb, line 3 def initialize(client:, id: nil, hash: nil) @client = client @id = id @hash = hash end
Public Instance Methods
create(body:)
click to toggle source
# File lib/Webhook.rb, line 11 def create(body:) response = @client.request("/webhook/add", method: :post, body: body) @id = response[:id] response end
delete()
click to toggle source
# File lib/Webhook.rb, line 17 def delete response = @client.request("/webhook/delete", method: :post, body: {id: @id}) @id = nil response end