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 offer the basics to export a register
This case expects options[:source][:register_id]
Direct Known Subclasses
Constant Summary
Constants included from Helpers::Filters
Helpers::Filters::FILTER_TIME_FORMAT
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.
Attributes included from Language::AuxiliarLogger
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::Filters
#date_range_filter, #days, #daystart, #field_key_name, #midnight, #previous_sunday, #set_time, #sunday, #tags_filter, #this_monday, #to_date_filter, #today, #weeks
Methods included from Helpers::Shortcuts
#bracked_regex, #clean_question, #is_number?, #non_letters_regex, #normalize_string, #object_reference, #same_string?, #simplify_string, #titleize, #to_i
Methods inherited from Common::Loaders::UseCase
cli, cli!, #cli_apply!, #initialize, type, #type
Methods inherited from Common::Loaders::CaseBase
Methods inherited from Common::Loaders::Base
<=>, created_at, #initialize, 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
Methods included from Language::AuxiliarLogger
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.
21 22 23 |
# File 'lib/eco/api/usecases/ooze_samples/register_export_case.rb', line 21 def @options end |
#session ⇒ Object (readonly)
Returns the value of attribute session.
21 22 23 |
# File 'lib/eco/api/usecases/ooze_samples/register_export_case.rb', line 21 def session @session end |
#target ⇒ Object (readonly)
Returns the value of attribute target.
22 23 24 |
# File 'lib/eco/api/usecases/ooze_samples/register_export_case.rb', line 22 def target @target end |
#usecase ⇒ Object (readonly)
Returns the value of attribute usecase.
21 22 23 |
# File 'lib/eco/api/usecases/ooze_samples/register_export_case.rb', line 21 def usecase @usecase end |
Class Method Details
.batch_size(size = nil) ⇒ Integer
Returns the number of pages to be processed in each batch.
9 10 11 12 13 |
# File 'lib/eco/api/usecases/ooze_samples/register_export_case.rb', line 9 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
24 25 26 27 28 29 30 31 32 33 |
# File 'lib/eco/api/usecases/ooze_samples/register_export_case.rb', line 24 def main(_session, , _usecase) [:end_get] = false @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
36 37 38 39 |
# File 'lib/eco/api/usecases/ooze_samples/register_export_case.rb', line 36 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 |