These are chat archives for dry-rb/chat
Next-gen ruby libs! » github.com/dry-rb » website: https://dry-rb.org » forum: https://discourse.dry-rb.org
require ‘my_string_utils’and then either include it within the class that uses it; or hardcode stuff like
StringUtils.methodinto the classes methods; or pass
StringUtilsinto the class’s constructor, and then use it as needed without a hardcoded dependency. The auto_injector could clearly be used to implement the final solution, which is typically the best one anyway. what about having the container register the individual functions, so that you could include them with exactly the granularity you need? thoughts on the wisdom of this? is there any builtin support for doing this as a bulk registration, or would you have to manually register each of the functions if you wanted to do something like this?