Class: Eco::API::UseCases::OozeSamples::RegisterUpdateCase

Inherits:
OozeBaseCase show all
Defined in:
lib/eco/api/usecases/ooze_samples/register_update_case.rb

Overview

Note:
  • You can define methods filters and search to change the target entries of the register
  • You need to define the process_ooze method

Use case to update a register This case expects options[:source][:register_id]

Constant Summary

Constants inherited from OozeBaseCase

OozeBaseCase::DRY_COUNT, OozeBaseCase::SAVE_PATCH

Instance Attribute Summary

Attributes inherited from OozeBaseCase

#options, #session, #target, #usecase

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Helpers::Shortcuts

#clean_question, #normalize_string, #object_reference, #same_string?, #titleize

Methods inherited from Common::Loaders::UseCase

#initialize, type, #type

Methods inherited from Common::Loaders::CaseBase

#name, name_only_once!

Methods inherited from Common::Loaders::Base

<=>, created_at, #initialize, #name, set_created_at!

Methods included from Common::ClassHelpers

#class_resolver, #descendants, #descendants?, #inheritable_attrs, #inheritable_class_vars, #inherited, #instance_variable_name, #new_class, #resolve_class, #to_constant

Constructor Details

This class inherits a constructor from Eco::API::Common::Loaders::UseCase

Class Method Details

.batch_size(size = nil) ⇒ Integer

Returns the number of pages to be processed in each batch.

Returns:

  • (Integer)

    the number of pages to be processed in each batch



10
11
12
13
14
# File 'lib/eco/api/usecases/ooze_samples/register_update_case.rb', line 10

def batch_size(size = nil)
  @batch_size ||= 25
  return @batch_size unless size
  @batch_size = size
end

Instance Method Details

#main(session, options, usecase, &block) ⇒ Object



20
21
22
23
24
25
26
# File 'lib/eco/api/usecases/ooze_samples/register_update_case.rb', line 20

def main(session, options, usecase, &block)
  super(session, options, usecase) do
    with_each_entry do |ooze|
      process_ooze(&block)
    end
  end
end

#process_ooze(ooze = target) ⇒ Object



28
29
30
# File 'lib/eco/api/usecases/ooze_samples/register_update_case.rb', line 28

def process_ooze(ooze = target)
  raise "You need to define this method"
end