Sha256: 87c552c7e9737f6aa0565540d517e4779d7c408237601fd236b4a2497eedb8a5

Contents?: true

Size: 435 Bytes

Versions: 4

Compression:

Stored size: 435 Bytes

Contents

module Dry::Initializer
  # Shared scope for several params and options
  class Scope
    private

    def initialize(klass, **options)
      @klass   = klass
      @options = options
    end

    def method_missing(name, *args, **options)
      return super unless respond_to? name
      @klass.send(name, *args, **@options.merge(options))
    end

    def respond_to_missing?(name, *)
      @klass.respond_to? name
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
dry-initializer-0.9.3 lib/dry/initializer/scope.rb
dry-initializer-0.9.2 lib/dry/initializer/scope.rb
dry-initializer-0.9.1 lib/dry/initializer/scope.rb
dry-initializer-0.9.0 lib/dry/initializer/scope.rb