Sha256: 795cb0eace19650fe51acf451f657832973675f2c9d7ad3a71bac51506f3c0f6
Contents?: true
Size: 886 Bytes
Versions: 9
Compression:
Stored size: 886 Bytes
Contents
# frozen_string_literal: true module Karafka module Params # Simple metadata object that stores all non-message information received from Kafka cluster # while fetching the data class Metadata < Hash # Attributes that should be accessible as methods as well (not only hash) METHOD_ATTRIBUTES = %w[ batch_size first_offset highwater_mark_offset last_offset offset_lag deserializer partition topic ].freeze private_constant :METHOD_ATTRIBUTES METHOD_ATTRIBUTES.each do |attr| # Defines a method call accessor to a particular hash field. define_method(attr) do self[attr] end end # @return [Boolean] is the last offset known or unknown def unknown_last_offset? self['unknown_last_offset'] end end end end
Version data entries
9 entries across 9 versions & 1 rubygems