Class: Eco::API::Custom::UseCase

Inherits:
Eco::API::Common::Loaders::UseCase show all
Defined in:
lib/eco/api/custom/use_case.rb

Overview

Helper class to create a custom UseCase

Examples:

Example of usage:

class Custom::UseCase::Sync < Eco::API::Custom::UseCase
  name "custom-case"
  type :sync

  def main(entries, people, session, options, usecase)
    update   = session.new_job("main", "update", :update, usecase)
    session.micro.with_each(entries, people, options) do |entry, person|
      # update some data in person using data from entry
    end
  end

end

Method Summary

Methods inherited from Eco::API::Common::Loaders::UseCase

#initialize, #main, type, #type

Methods inherited from Eco::API::Common::BaseLoader

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

Methods included from Eco::API::Common::ClassHelpers

#class_resolver, #descendants, #descendants?, #new_class, #resolve_class, #to_constant

Constructor Details

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