lib/eco/api/session.rb in eco-helpers-0.9.1 vs lib/eco/api/session.rb in eco-helpers-0.9.2

- old
+ new

@@ -1,10 +1,10 @@ module Eco module API class Session < Common::Session::BaseSession - attr_reader :batch - attr_reader :job_groups + attr_reader :batch, :job_groups + attr_reader :usecases attr_accessor :schema def initialize(init = {}) e = init msg = "Expected object Eco::API::Session::Config or Eco::API::Common::Session::Environment. Given: #{init}" @@ -16,11 +16,11 @@ @batch = Batch.new(enviro) @task = Task.new(enviro) @job_groups = JobGroups.new(enviro) - @use_cases = Eco::API::UseCases::DefaultCases.new.merge(config.usecases) + @usecases = Eco::API::UseCases::DefaultCases.new.merge(config.usecases) self.schema = config.people.default_schema || schemas.first @policy_groups = config.policy_groups presets_custom_file = config.people.presets_custom @@ -140,12 +140,12 @@ csv_entries(file) end def process_case(name, type: nil, **params) args = { session: self }.merge(params) - fatal("Undefined usecase '#{name}' of type '#{type.to_s}'") if !@use_cases.defined?(name, type: type) + fatal("Undefined usecase '#{name}' of type '#{type.to_s}'") if !usecases.defined?(name, type: type) logger.debug("Session: going to process '#{name}' defined case") - @use_cases.case(name, type: type).launch(**args) + usecases.case(name, type: type).launch(**args) end def job_group(name, order: :last) case when job_groups.exists?(name)