Sha256: 1463e3f5d03b89419333d246be3f8c6900f5cbaee5f8fa7c19bad60e489b3b9b

Contents?: true

Size: 1.17 KB

Versions: 11

Compression:

Stored size: 1.17 KB

Contents

class Object

  def self.lev_routine(options={})
    class_eval do
      include Lev::Routine unless options[:skip_routine_include]

      # Routine configuration
      options[:transaction] ||= Lev::TransactionIsolation.mysql_default.symbol
      @transaction_isolation = Lev::TransactionIsolation.new(options[:transaction])

      @active_job_queue = options[:active_job_queue]

      @raise_fatal_errors = options[:raise_fatal_errors]

      @delegates_to = options[:delegates_to]
      if @delegates_to
        uses_routine @delegates_to,
                     translations: {
                       outputs: { type: :verbatim },
                       inputs: { type: :verbatim }
                     }

        @express_output ||= @delegates_to.express_output
      end

      # Set this after dealing with "delegates_to" in case it set a value
      @express_output ||= options[:express_output] || self.name.demodulize.underscore
    end
  end

  def self.lev_handler(options={})
    class_eval do
      include Lev::Handler
    end

    # Do routine configuration
    options[:skip_routine_include] = true
    lev_routine(options)

    # Do handler configuration (none currently)
  end

end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
lev-7.1.0 lib/lev/object.rb
lev-7.0.3 lib/lev/object.rb
lev-7.0.2 lib/lev/object.rb
lev-7.0.1 lib/lev/object.rb
lev-7.0.0 lib/lev/object.rb
lev-6.0.0 lib/lev/object.rb
lev-5.0.0 lib/lev/object.rb
lev-4.3.2 lib/lev/object.rb
lev-4.3.1 lib/lev/object.rb
lev-4.3.0 lib/lev/object.rb
lev-4.2.0 lib/lev/object.rb