Class: MockChargebee::Webhook
- Inherits:
-
Object
- Object
- MockChargebee::Webhook
- Defined in:
- lib/mock_chargebee/webhook.rb
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(event_type, event_attributes = {}, content_attributes = {}) ⇒ Webhook
constructor
A new instance of Webhook.
Constructor Details
#initialize(event_type, event_attributes = {}, content_attributes = {}) ⇒ Webhook
Returns a new instance of Webhook.
3 4 5 6 7 |
# File 'lib/mock_chargebee/webhook.rb', line 3 def initialize(event_type, event_attributes = {}, content_attributes = {}) @event_type = event_type @event_attributes = event_attributes.stringify_keys @content_attributes = content_attributes.stringify_keys end |
Instance Method Details
#call ⇒ Object
9 10 11 12 13 14 15 16 |
# File 'lib/mock_chargebee/webhook.rb', line 9 def call Validations::Webhooks::EventAttributes.validate_allowed(event_attributes) event_attributes.merge!("content" => content_attributes) response = fixture.deep_merge(event_attributes) response.to_json end |