Class: RubyEventStore::Outbox::FetchSpecification

Inherits:
Object
  • Object
show all
Defined in:
lib/ruby_event_store/outbox/fetch_specification.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(message_format, split_key) ⇒ FetchSpecification

Returns a new instance of FetchSpecification.



6
7
8
9
10
# File 'lib/ruby_event_store/outbox/fetch_specification.rb', line 6

def initialize(message_format, split_key)
  @message_format = message_format
  @split_key = split_key
  freeze
end

Instance Attribute Details

#message_formatObject (readonly)

Returns the value of attribute message_format.



12
13
14
# File 'lib/ruby_event_store/outbox/fetch_specification.rb', line 12

def message_format
  @message_format
end

#split_keyObject (readonly)

Returns the value of attribute split_key.



12
13
14
# File 'lib/ruby_event_store/outbox/fetch_specification.rb', line 12

def split_key
  @split_key
end

Instance Method Details

#==(other) ⇒ Object Also known as: eql?



14
15
16
# File 'lib/ruby_event_store/outbox/fetch_specification.rb', line 14

def ==(other)
  other.instance_of?(self.class) && other.message_format.eql?(message_format) && other.split_key.eql?(split_key)
end

#hashObject



18
19
20
# File 'lib/ruby_event_store/outbox/fetch_specification.rb', line 18

def hash
  [message_format, split_key].hash ^ self.class.hash
end