You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Kan::Application.new(comment: Comments::Abilities.new)# => will use default Logger
custom application class
ProjectAbilityApplication.new(comment: Comments::Abilities.new)# => will use default MyLogger
custom application class with other value
ProjectAbilityApplication.new(comment: Comments::Abilities.new(logger: MyOtherLogger.new))# => will use MyOtherLogger
WDYT?
UPD agter small talk with @apotonick: Maybe we need to use instance variable for settings and #call for generating a builder class 🤔
Kan::Application.new.call(comment: Comments::Abilities.new)# => will use default LoggerKan::Application.new(logger: MyLogger.new).call(comment: Comments::Abilities.new)# will use MyLoggerKan::Application.new(logger: MyLogger.new).call(comment: Comments::Abilities.new(logger: MyOtherLogger.new))# => will use MyOtherLogger
The text was updated successfully, but these errors were encountered:
Hey, I like the third step where you can override it as an argument, but I don't understand how the ProjectAbilityApplication manages to set a MyLogger on the Comments ability object. Are you using a writer internally for that? Because that I think I wouldn't like.
Now we have a simple problem: how to set up default values for each abilities instance in one place?
I sugest to use something like this:
After that we can initialize:
WDYT?
UPD agter small talk with @apotonick: Maybe we need to use instance variable for settings and
#call
for generating a builder class 🤔The text was updated successfully, but these errors were encountered: