-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Introduce Services module #875
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder whether it's worth also moving the ORGANISATIONS_API_BASE_PATH
constant from its initializer into the new Services
module. It might be worth seeing what other applications do.
Other than that minor suggestion, this looks good to me.
This removes some duplication and will make it clearer that this needs to change when I introduce a `Services` module to hold the various API clients.
Using a `Services` module to keep all the GdsApi clients together is a pattern used in a number of other GOV.UK apps. I'm manually requiring "services" where appropriate as the lib directory isn't in the array of `autoload_paths`.
Using a `Services` module to keep all the GdsApi clients together is a pattern used in a number of other GOV.UK apps. I'm manually requiring "services" where appropriate as the lib directory isn't in the array of `autoload_paths`. Note that we're already requiring "services" in abstract_manual_document_service_registry.rb so I haven't had to require it again.
Using a `Services` module to keep all the GdsApi clients together is a pattern used in a number of other GOV.UK apps. I'm manually requiring "services" where appropriate as the lib directory isn't in the array of `autoload_paths`.
Using a `Services` module to keep all the GdsApi clients together is a pattern used in a number of other GOV.UK apps. I'm manually requiring "services" where appropriate as the lib directory isn't in the array of `autoload_paths`. Note that we're already requiring "services" in section_reslugger.rb so I haven't had to require it again.
Using a `Services` module to keep all the GdsApi clients together is a pattern used in a number of other GOV.UK apps. I'm manually requiring "services" where appropriate as the lib directory isn't in the array of `autoload_paths`.
Using a `Services` module to keep all the GdsApi clients together is a pattern used in a number of other GOV.UK apps. Note that we're already requiring "services" in section_reslugger.rb so I haven't had to require it again.
I had a quick look at how other apps are instantiating |
I've somewhat arbitrarily chosen `Plek.find` but this could just as easily be `Plek.new.find` or `Plek.current.find`.
5eafccf
to
b999ce9
Compare
Using a
Services
module to keep all the GdsApi clients together is a pattern used in a number of other GOV.UK apps.As suggested by @h-lame.
Fixes issue #811.