• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

sue445 / pixela / #12148

26 Dec 2025 11:22AM UTC coverage: 44.444% (-53.8%) from 98.195%
#12148

push

web-flow
Merge b4c2c510f into 6f2b98fd6

120 of 270 relevant lines covered (44.44%)

0.44 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

35.71
/lib/pixela/client/webhook_methods.rb
1
module Pixela::Client::WebhookMethods
1✔
2
  # Create a new Webhook.
3
  #
4
  # @param graph_id [String]
5
  # @param type     [String]
6
  #
7
  # @return [Pixela::Response]
8
  #
9
  # @raise [Pixela::PixelaError] API is failed
10
  #
11
  # @see https://docs.pixe.la/entry/post-webhook
12
  #
13
  # @example
14
  #   client.create_webhook(graph_id: "test-graph", type: "increment")
15
  def create_webhook(graph_id:, type:)
1✔
16
    params = {
17
      graphID: graph_id,
×
18
      type:    type,
19
    }
20

21
    with_error_handling do
×
22
      connection.post("users/#{username}/webhooks", params).body
×
23
    end
24
  end
25

26
  # Get all predefined webhooks definitions.
27
  #
28
  # @return [Array<Hashie::Mash>]
29
  #
30
  # @raise [Pixela::PixelaError] API is failed
31
  #
32
  # @see https://docs.pixe.la/entry/get-webhooks
33
  #
34
  # @example
35
  #   client.get_webhooks
36
  def get_webhooks
1✔
37
    with_error_handling do
×
38
      connection.get("users/#{username}/webhooks").body.webhooks
×
39
    end
40
  end
41

42
  # Invoke the webhook registered in advance.
43
  #
44
  # @param webhook_hash [String]
45
  #
46
  # @return [Pixela::Response]
47
  #
48
  # @raise [Pixela::PixelaError] API is failed
49
  #
50
  # @see https://docs.pixe.la/entry/invoke-webhook
51
  #
52
  # @example
53
  #   client.invoke_webhook(webhook_hash: "<webhookHash>")
54
  def invoke_webhook(webhook_hash:)
1✔
55
    with_error_handling do
×
56
      connection(request_headers: default_headers).post("users/#{username}/webhooks/#{webhook_hash}").body
×
57
    end
58
  end
59

60
  # Delete the registered Webhook.
61
  #
62
  # @param webhook_hash [String]
63
  #
64
  # @return [Pixela::Response]
65
  #
66
  # @raise [Pixela::PixelaError] API is failed
67
  #
68
  # @see https://docs.pixe.la/entry/delete-webhook
69
  #
70
  # @example
71
  #   client.delete_webhook(webhook_hash: "<webhookHash>")
72
  def delete_webhook(webhook_hash:)
1✔
73
    with_error_handling do
×
74
      connection.delete("users/#{username}/webhooks/#{webhook_hash}").body
×
75
    end
76
  end
77
end
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc