Class: N1Loader::LoaderBuilder

Inherits:
Object
  • Object
show all
Defined in:
lib/n1_loader/core/loader_builder.rb

Overview

The class builds Loader

Class Method Summary collapse

Class Method Details

.build(&block) ⇒ Object



6
7
8
9
10
11
12
13
14
# File 'lib/n1_loader/core/loader_builder.rb', line 6

def self.build(&block)
  Class.new(N1Loader::Loader) do
    if block.arity == 1
      define_method(:perform, &block)
    else
      class_eval(&block)
    end
  end
end