Class: Eco::API::UseCases::OozeSamples::OozeRunBaseCase

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

Overview

Base class to run a script against a single ooze.

Direct Known Subclasses

OozeUpdateCase

Constant Summary collapse

SAVE_PATCH =
"ooze_patch_update.json"

Constants inherited from OozeBaseCase

Eco::API::UseCases::OozeSamples::OozeBaseCase::DRY_COUNT

Constants included from Helpers::Filters

Helpers::Filters::FILTER_TIME_FORMAT

Instance Attribute Summary

Attributes inherited from OozeBaseCase

#target

Attributes included from Language::AuxiliarLogger

#logger

Instance Method Summary collapse

Methods included from Helpers::Rescuable

validate_base_type!

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

#name, name_only_once!

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

#log

Constructor Details

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

Instance Method Details

#main(session, options, usecase) ⇒ Object



8
9
10
11
12
13
14
15
16
17
18
19
20
# File 'lib/eco/api/usecases/ooze_samples/ooze_run_base_case.rb', line 8

def main(session, options, usecase)
  super(session, options, usecase) do
    if method(:process_ooze).parameters.count == 0
      ooze # retrieve ooze
      process_ooze
    else
      process_ooze(ooze)
    end
    yield(target) if block_given?
    exit_if_no_changes!
    update_ooze(target)
  end
end

#process_ooze(page = target) ⇒ Object



22
23
24
# File 'lib/eco/api/usecases/ooze_samples/ooze_run_base_case.rb', line 22

def process_ooze(page = target)
  raise "You need to redefine this method"
end