Class: CC::Kafka::OffsetStorage::Memory

Inherits:
Struct
  • Object
show all
Defined in:
lib/cc/kafka/offset_storage/memory.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#currentObject

Returns the value of attribute current

Returns:

  • (Object)

    the current value of current



4
5
6
# File 'lib/cc/kafka/offset_storage/memory.rb', line 4

def current
  @current
end

#partitionObject

Returns the value of attribute partition

Returns:

  • (Object)

    the current value of partition



4
5
6
# File 'lib/cc/kafka/offset_storage/memory.rb', line 4

def partition
  @partition
end

#topicObject

Returns the value of attribute topic

Returns:

  • (Object)

    the current value of topic



4
5
6
# File 'lib/cc/kafka/offset_storage/memory.rb', line 4

def topic
  @topic
end

Class Method Details

.find_or_create!(attrs) ⇒ Object



5
6
7
# File 'lib/cc/kafka/offset_storage/memory.rb', line 5

def self.find_or_create!(attrs)
  @offset ||= new(attrs[:topic], attrs[:partition], nil)
end

Instance Method Details

#set(attrs) ⇒ Object



9
10
11
# File 'lib/cc/kafka/offset_storage/memory.rb', line 9

def set(attrs)
  attrs.each { |k, v| self[k] = v }
end