Sha256: b98159d2d263ed04666950394590306bb17386d947c154436b8e55afe4ee6bc8

Contents?: true

Size: 297 Bytes

Versions: 8

Compression:

Stored size: 297 Bytes

Contents

module Dependor
  module Injectable
    def inject_from(klass)
      define_method :injector do
        @injector ||= klass.new
      end
    end

    def inject(*names)
      names.each do |name|
        define_method name do
          injector.send(name)
        end
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
dependor-1.0.1 lib/dependor/injectable.rb
dependor-1.0.0 lib/dependor/injectable.rb
dependor-0.0.6 lib/dependor/injectable.rb
dependor-0.0.5 lib/dependor/injectable.rb
dependor-0.0.4 lib/dependor/injectable.rb
dependor-0.0.3 lib/dependor/injectable.rb
dependor-0.0.2 lib/dependor/injectable.rb
dependor-0.0.1 lib/dependor/injectable.rb