Skip to content

Commit

Permalink
should be able to call dispatch on an event class (#16)
Browse files Browse the repository at this point in the history
  • Loading branch information
mathieujobin authored Nov 11, 2019
1 parent 8a435d8 commit 7ba2adc
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 2 deletions.
36 changes: 35 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,42 @@
# Change Log

## [v2.2.0](https://github.com/payrollhero/webhook_system/tree/v2.2.0) (2019-11-07)
[Full Changelog](https://github.com/payrollhero/webhook_system/compare/v2.1.6...v2.2.0)

* Syntatic sugar: simple dispatch call to also build the event object

## [v2.1.6](https://github.com/payrollhero/webhook_system/tree/v2.1.6) (2019-07-26)
[Full Changelog](https://github.com/payrollhero/webhook_system/compare/v2.1.5...v2.1.6)

* add account info to error message

## [v2.1.5](https://github.com/payrollhero/webhook_system/tree/v2.1.5) (2019-07-24)
[Full Changelog](https://github.com/payrollhero/webhook_system/compare/v2.1.4...v2.1.5)

* response body error message in exception

## [v2.1.4](https://github.com/payrollhero/webhook_system/tree/v2.1.4) (2019-05-10)
[Full Changelog](https://github.com/payrollhero/webhook_system/compare/v2.1.3...v2.1.4)

* Make URL display in Exception message
* Make tests pass again
* Small typo fix by Heath Attig, thank you

## [v2.1.3](https://github.com/payrollhero/webhook_system/tree/v2.1.3) (2017-12-06)
[Full Changelog](https://github.com/payrollhero/webhook_system/compare/v2.1.2...v2.1.3)

by Ron

## [v2.1.2](https://github.com/payrollhero/webhook_system/tree/v2.1.2) (2017-01-24)
[Full Changelog](https://github.com/payrollhero/webhook_system/compare/v2.1.1...v2.1.2)

by Piotr

## [v2.1.1](https://github.com/payrollhero/webhook_system/tree/v2.1.1) (2016-12-20)
[Full Changelog](https://github.com/payrollhero/webhook_system/compare/v2.1.0...v2.1.1)

by Piotr

## [v2.1.0](https://github.com/payrollhero/webhook_system/tree/v2.1.0) (2016-07-20)
[Full Changelog](https://github.com/payrollhero/webhook_system/compare/v2.0.0...v2.1.0)

Expand Down Expand Up @@ -53,4 +87,4 @@



\* *This Change Log was automatically generated by [github_changelog_generator](https://github.com/skywinder/Github-Changelog-Generator)*
\* *This Change Log was automatically generated by [github_changelog_generator](https://github.com/skywinder/Github-Changelog-Generator)*
4 changes: 4 additions & 0 deletions lib/webhook_system/base_event.rb
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@ def self.key_is_reserved?(key)
key.to_s.in? %w(event event_id)
end

def self.dispatch(args)
WebhookSystem::Subscription.global.dispatch self.build(args)
end

private

def with_caller_backtrace(exception, backtrack=2)
Expand Down
2 changes: 1 addition & 1 deletion lib/webhook_system/version.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module WebhookSystem
VERSION = '2.1.6'
VERSION = '2.2.0'
end

0 comments on commit 7ba2adc

Please sign in to comment.