Sha256: 02db3c0cd96785c9379cead8cbba0aad9792c7e72ef6af8aee65130c98ba7fe5

Contents?: true

Size: 622 Bytes

Versions: 1

Compression:

Stored size: 622 Bytes

Contents

# frozen_string_literal: true

module PagesCore
  module Templates
    class ConfigurationProxy
      def initialize(callback, parent = nil)
        @callback = callback
        @parent = parent
      end

      def method_missing(method_name, *, &block)
        if @parent && block
          @callback.call(@parent, method_name, block)
        elsif @parent
          @callback.call(@parent, method_name, *)
        elsif block
          @callback.call(method_name, block)
        else
          @callback.call(method_name, *)
        end
      end

      def respond_to_missing?
        true
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
pages_core-3.15.5 lib/pages_core/templates/configuration_proxy.rb