Sha256: fc46daa728b703481ffbd264aada867cd4d048784cfdb2f1c7dc6a737b38f1ab

Contents?: true

Size: 722 Bytes

Versions: 4

Compression:

Stored size: 722 Bytes

Contents

require "docile/fallback_context_proxy"

module Docile
  # @api private
  #
  # Operates in the same manner as {FallbackContextProxy}, but replacing
  # the primary `receiver` object with the result of each proxied method.
  #
  # This is useful for implementing DSL evaluation for immutable context
  # objects.
  #
  # @see Docile.dsl_eval_immutable
  class ChainingFallbackContextProxy < FallbackContextProxy
    # Proxy methods as in {FallbackContextProxy#method_missing}, replacing
    # `receiver` with the returned value.
    def method_missing(method, *args, &block)
      @__receiver__ = super(method, *args, &block)
    end
    
    ruby2_keywords :method_missing if respond_to?(:ruby2_keywords, true)
  end
end

Version data entries

4 entries across 3 versions & 2 rubygems

Version Path
tdiary-5.1.6 vendor/bundle/ruby/2.7.0/gems/docile-1.3.5/lib/docile/chaining_fallback_context_proxy.rb
tdiary-5.1.6 vendor/bundle/ruby/2.7.0/gems/tdiary-5.1.5/vendor/bundle/ruby/2.7.0/gems/docile-1.3.5/lib/docile/chaining_fallback_context_proxy.rb
tdiary-5.1.5 vendor/bundle/ruby/2.7.0/gems/docile-1.3.5/lib/docile/chaining_fallback_context_proxy.rb
docile-1.3.5 lib/docile/chaining_fallback_context_proxy.rb