Class: Eco::API::UseCases::OozeSamples::RegisterExportCase
- Inherits:
-
Common::Loaders::UseCase
- Object
- Common::Loaders::Base
- Common::Loaders::CaseBase
- Common::Loaders::UseCase
- Eco::API::UseCases::OozeSamples::RegisterExportCase
- Includes:
- Helpers
- Defined in:
- lib/eco/api/usecases/ooze_samples/register_export_case.rb
Overview
- You can define methods
filters
andsearch
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]
Instance Attribute Summary collapse
-
#options ⇒ Object
readonly
Returns the value of attribute options.
-
#session ⇒ Object
readonly
Returns the value of attribute session.
-
#target ⇒ Object
readonly
Returns the value of attribute target.
-
#usecase ⇒ Object
readonly
Returns the value of attribute usecase.
Class Method Summary collapse
-
.batch_size(size = nil) ⇒ Integer
The number of pages to be processed in each batch.
Instance Method Summary collapse
- #main(session, options, usecase) ⇒ Object
-
#process_ooze(ooze = target) {|ooze| ... } ⇒ Object
Write here your script.
Methods included from Helpers::Shortcuts
#clean_question, #is_number?, #normalize_string, #object_reference, #same_string?, #titleize, #to_i
Methods inherited from Common::Loaders::UseCase
Methods inherited from Common::Loaders::CaseBase
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
Instance Attribute Details
#options ⇒ Object (readonly)
Returns the value of attribute options.
22 23 24 |
# File 'lib/eco/api/usecases/ooze_samples/register_export_case.rb', line 22 def @options end |
#session ⇒ Object (readonly)
Returns the value of attribute session.
22 23 24 |
# File 'lib/eco/api/usecases/ooze_samples/register_export_case.rb', line 22 def session @session end |
#target ⇒ Object (readonly)
Returns the value of attribute target.
23 24 25 |
# File 'lib/eco/api/usecases/ooze_samples/register_export_case.rb', line 23 def target @target end |
#usecase ⇒ Object (readonly)
Returns the value of attribute usecase.
22 23 24 |
# File 'lib/eco/api/usecases/ooze_samples/register_export_case.rb', line 22 def usecase @usecase end |
Class Method Details
.batch_size(size = nil) ⇒ Integer
Returns the number of pages to be processed in each batch.
10 11 12 13 14 |
# File 'lib/eco/api/usecases/ooze_samples/register_export_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) ⇒ Object
25 26 27 28 29 30 31 32 33 34 |
# File 'lib/eco/api/usecases/ooze_samples/register_export_case.rb', line 25 def main(session, , usecase) [:end_get] = false @session = session; @options = ; @usecase = usecase @target = nil raise "You need to inherit from this class ('#{self.class}') and call super with a block" unless block_given? with_each_entry do |ooze| process_ooze(ooze) end yield end |
#process_ooze(ooze = target) {|ooze| ... } ⇒ Object
Write here your script
37 38 39 40 |
# File 'lib/eco/api/usecases/ooze_samples/register_export_case.rb', line 37 def process_ooze(ooze = target) raise "You need to inherit from this class ('#{self.class}') and call super with a block" unless block_given? yield(ooze) end |