Class: Pixela::Webhook

Inherits:
Object
  • Object
show all
Defined in:
lib/pixela/webhook.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(client:, webhook_hash:) ⇒ Webhook

Returns a new instance of Webhook.

Parameters:



13
14
15
16
# File 'lib/pixela/webhook.rb', line 13

def initialize(client:, webhook_hash:)
  @client       = client
  @webhook_hash = webhook_hash
end

Instance Attribute Details

#clientPixela::Client (readonly)

Returns:



5
6
7
# File 'lib/pixela/webhook.rb', line 5

def client
  @client
end

#webhook_hashString (readonly)

Returns:

  • (String)


9
10
11
# File 'lib/pixela/webhook.rb', line 9

def webhook_hash
  @webhook_hash
end

Instance Method Details

#deletePixela::Response

Delete the registered Webhook.

Examples:

client.webhook("<webhookHash>").delete

Returns:

Raises:

See Also:



42
43
44
# File 'lib/pixela/webhook.rb', line 42

def delete
  client.delete_webhook(webhook_hash: webhook_hash)
end

#invokePixela::Response

Invoke the webhook registered in advance.

Examples:

client.webhook("<webhookHash>").invoke

Returns:

Raises:

See Also:



28
29
30
# File 'lib/pixela/webhook.rb', line 28

def invoke
  client.invoke_webhook(webhook_hash: webhook_hash)
end