lib/eco/api/session.rb in eco-helpers-1.5.7 vs lib/eco/api/session.rb in eco-helpers-1.5.8

- old
+ new

@@ -215,10 +215,11 @@ # @return [Eco::API::Session::Batch::JobsGroups] def job_groups @job_groups ||= Batch::JobsGroups.new(enviro) end + # It retrives the group of `Batch::Jobs` named `name`. It creates it if it doesn't exist. # @return [Eco::API::Session::Batch::Jobs] def job_group(name, order: :last) case when job_groups.exists?(name) job_groups[name] @@ -226,12 +227,13 @@ job_groups.new(name, order: order) end end # Shortcut to create a job of certain type within a group + # @param [see @Eco::API::Session::Batch::Jobs#new] # @return [Eco::API::Session::Batch::Job] - def new_job(group, name, type, usecase, sets = [:core, :details, :account]) - job_group(group).new(name, usecase: usecase, type: type, sets: sets) + def new_job(group, name, type, usecase, sets = [:core, :details, :account], &block) + job_group(group).new(name, usecase: usecase, type: type, sets: sets, &block) end # @see Eco::API::Session::Batch::JobsGroups#launch def jobs_launch(simulate: false) job_groups.launch(simulate: simulate)