Sha256: e1caace29d6418d073a1e5369c1c3b2d52a482b914b9c3865bfff573b006085a

Contents?: true

Size: 718 Bytes

Versions: 20

Compression:

Stored size: 718 Bytes

Contents

# frozen_string_literal: true

module TableSync::Receiving
  class ConfigDecorator
    extend Forwardable

    def_delegators :@config, :allow_event?
    # rubocop:disable Metrics/ParameterLists
    def initialize(config:, event:, model:, version:, project_id:, raw_data:)
      @config = config

      @default_params = {
        event: event,
        model: model,
        version: version,
        project_id: project_id,
        raw_data: raw_data,
      }
    end
    # rubocop:enable Metrics/ParameterLists

    def method_missing(name, **additional_params, &block)
      value = @config.send(name)
      value.is_a?(Proc) ? value.call(@default_params.merge(additional_params), &block) : value
    end
  end
end

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
table_sync-6.5.1 lib/table_sync/receiving/config_decorator.rb
table_sync-6.5.0 lib/table_sync/receiving/config_decorator.rb
table_sync-6.4.2 lib/table_sync/receiving/config_decorator.rb
table_sync-6.4.1 lib/table_sync/receiving/config_decorator.rb
table_sync-6.4.0 lib/table_sync/receiving/config_decorator.rb
table_sync-6.3.0 lib/table_sync/receiving/config_decorator.rb
table_sync-6.1.0 lib/table_sync/receiving/config_decorator.rb
table_sync-6.0.4 lib/table_sync/receiving/config_decorator.rb
table_sync-6.0.3 lib/table_sync/receiving/config_decorator.rb
table_sync-6.0.2 lib/table_sync/receiving/config_decorator.rb
table_sync-6.0 lib/table_sync/receiving/config_decorator.rb
table_sync-5.1.0 lib/table_sync/receiving/config_decorator.rb
table_sync-5.0.0 lib/table_sync/receiving/config_decorator.rb
table_sync-4.2.2 lib/table_sync/receiving/config_decorator.rb
table_sync-4.2.1 lib/table_sync/receiving/config_decorator.rb
table_sync-4.2.0 lib/table_sync/receiving/config_decorator.rb
table_sync-4.1.3 lib/table_sync/receiving/config_decorator.rb
table_sync-4.1.1 lib/table_sync/receiving/config_decorator.rb
table_sync-4.1.0 lib/table_sync/receiving/config_decorator.rb
table_sync-4.0.0 lib/table_sync/receiving/config_decorator.rb