lib/eco/api/usecases/use_case_io.rb in eco-helpers-1.3.7 vs lib/eco/api/usecases/use_case_io.rb in eco-helpers-1.3.8
- old
+ new
@@ -23,14 +23,12 @@
# @see Eco::API::UseCases::BaseIO#new
# @param usecase [Eco::API::UseCases::UseCase] target usecase
# @return [Eco::API::UseCases::UseCaseIO]
def new(usecase:, **kargs)
- default = {
- usecase: usecase,
- job: @job
- }
+ default = { usecase: usecase }
+ default.merge!(job: @job) if @job
super(**default.merge(kargs))
end
# @param value [Eco::API::UseCases::UseCase] the usecase this InputOuput should be linked to
@@ -51,15 +49,13 @@
# @see Eco::API::UseCases::BaseIO#params
# Same as its superclass but adding `usecase` parameter
def params(keyed: false)
super(keyed: keyed).tap do |res|
if keyed
- res.merge!({
- usecase: usecase,
- job: @job
- })
+ res.merge!(usecase: usecase)
+ res.merge!(job: @job) if @job
else
- res.push(usecase).push(@job)
+ res.push(usecase).push(@job) if @job
end
end
end
def chain(usecase:)