Sha256: b9cb2747461d61fe0165c77340e17a00243a0631be4de9aaff133daabb948d4f

Contents?: true

Size: 592 Bytes

Versions: 11

Compression:

Stored size: 592 Bytes

Contents

# frozen_string_literal: true

module TableSync::Publishing::Params
  class Single < Base
    attr_reader :object, :routing_key, :headers

    def initialize(object:)
      @object      = object
      @routing_key = calculated_routing_key
      @headers     = calculated_headers
    end

    private

    def object_class
      object.object_class.name
    end

    def attributes_for_routing_key
      object.attributes_for_routing_key
    end

    def attributes_for_headers
      object.attributes_for_headers
    end

    def exchange_name
      TableSync.exchange_name
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
table_sync-6.5.1 lib/table_sync/publishing/params/single.rb
table_sync-6.5.0 lib/table_sync/publishing/params/single.rb
table_sync-6.4.2 lib/table_sync/publishing/params/single.rb
table_sync-6.4.1 lib/table_sync/publishing/params/single.rb
table_sync-6.4.0 lib/table_sync/publishing/params/single.rb
table_sync-6.3.0 lib/table_sync/publishing/params/single.rb
table_sync-6.1.0 lib/table_sync/publishing/params/single.rb
table_sync-6.0.4 lib/table_sync/publishing/params/single.rb
table_sync-6.0.3 lib/table_sync/publishing/params/single.rb
table_sync-6.0.2 lib/table_sync/publishing/params/single.rb
table_sync-6.0 lib/table_sync/publishing/params/single.rb