pusher / push-notifications-ruby

Pusher Beams Ruby Server SDK
https://www.pusher.com/beams
MIT License
18 stars 9 forks source link

Simplify UseCases implementation and fix issue with multiple configurations #29

Closed sonologico closed 2 years ago

sonologico commented 2 years ago

Description

Simplify internal implementation. The functionality of the library is split into multiple classes in the UseCases module. Functions in those classes were called by the main PushNotification class through delegation. This PR simplifies the code by using plain functions and calling them in the PushNotification class. This leads to less code, less indirection and less allocation. It also makes it easier to pass parameters from PushNotification to the UseCases functions, such as the correct client, which fixes the issue with multiple instances where the global client would still be used.

Fixes #28.

CHANGELOG

codecov-commenter commented 2 years ago

Codecov Report

Merging #29 (303daae) into master (5d98c47) will not change coverage. The diff coverage is 100.00%.

:exclamation: Current head 303daae differs from pull request most recent head be374dd. Consider uploading reports for the commit be374dd to get more accurate results

Impacted file tree graph

@@            Coverage Diff            @@
##            master       #29   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            6         6           
  Lines          298       319   +21     
=========================================
+ Hits           298       319   +21     
Impacted Files Coverage Δ
...er/push_notifications/publish_to_interests_spec.rb 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 5d98c47...be374dd. Read the comment docs.