Module: StripeWebhooks::Callbacks::ClassMethods
- Defined in:
- lib/stripe_webhooks/callbacks.rb
Instance Attribute Summary collapse
-
#callbacks ⇒ Object
readonly
Returns the value of attribute callbacks.
Instance Method Summary collapse
-
#register_callback(label) ⇒ Object
Add a callback to be ran whenever a new event is recorded.
Instance Attribute Details
#callbacks ⇒ Object (readonly)
Returns the value of attribute callbacks.
9 10 11 |
# File 'lib/stripe_webhooks/callbacks.rb', line 9 def callbacks @callbacks end |
Instance Method Details
#register_callback(label) ⇒ Object
Add a callback to be ran whenever a new event is recorded
Example
StripeWebhooks.register_callback('my_callback')
17 18 19 |
# File 'lib/stripe_webhooks/callbacks.rb', line 17 def register_callback(label) @callbacks << label unless @callbacks.include?(label) || label == 'application' end |