Sha256: e548af5f38b3a8e6a3c674bbf7961cb5812a379143adba146cbf7f751afe714d

Contents?: true

Size: 453 Bytes

Versions: 4

Compression:

Stored size: 453 Bytes

Contents

# frozen_string_literal: true

module BBK
  module App
    class Factory

      attr_accessor :klass, :instanceargs, :instancekwargs

      def initialize(klass, *args, **kwargs)
        @klass = klass
        @instanceargs = args
        @instancekwargs = kwargs
      end

      def create
        klass.new(*instanceargs, **instancekwargs)
      end

      def call(*args, **kwargs)
        create.call(*args, **kwargs)
      end

    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
bbk-app-1.0.0.78020 lib/bbk/app/factory.rb
bbk-app-1.0.0.72920 lib/bbk/app/factory.rb
bbk-app-1.0.0.72917 lib/bbk/app/factory.rb
bbk-app-1.0.0.72899 lib/bbk/app/factory.rb