Class: Smplkit::Config::ConfigChangeEvent

Inherits:
Object
  • Object
show all
Defined in:
lib/smplkit/config/client.rb

Overview

Describes a single config value change. Frozen — fields are set at construction and cannot be mutated afterward.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(config_id:, item_key:, old_value:, new_value:, source:) ⇒ ConfigChangeEvent

Returns a new instance of ConfigChangeEvent.



188
189
190
191
192
193
194
195
# File 'lib/smplkit/config/client.rb', line 188

def initialize(config_id:, item_key:, old_value:, new_value:, source:)
  @config_id = config_id
  @item_key = item_key
  @old_value = old_value
  @new_value = new_value
  @source = source
  freeze
end

Instance Attribute Details

#config_idObject (readonly)

Returns the value of attribute config_id.



186
187
188
# File 'lib/smplkit/config/client.rb', line 186

def config_id
  @config_id
end

#item_keyObject (readonly)

Returns the value of attribute item_key.



186
187
188
# File 'lib/smplkit/config/client.rb', line 186

def item_key
  @item_key
end

#new_valueObject (readonly)

Returns the value of attribute new_value.



186
187
188
# File 'lib/smplkit/config/client.rb', line 186

def new_value
  @new_value
end

#old_valueObject (readonly)

Returns the value of attribute old_value.



186
187
188
# File 'lib/smplkit/config/client.rb', line 186

def old_value
  @old_value
end

#sourceObject (readonly)

Returns the value of attribute source.



186
187
188
# File 'lib/smplkit/config/client.rb', line 186

def source
  @source
end

Instance Method Details

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



197
198
199
200
201
202
# File 'lib/smplkit/config/client.rb', line 197

def ==(other)
  other.is_a?(ConfigChangeEvent) &&
    config_id == other.config_id && item_key == other.item_key &&
    old_value == other.old_value && new_value == other.new_value &&
    source == other.source
end

#hashObject



205
# File 'lib/smplkit/config/client.rb', line 205

def hash = [config_id, item_key, old_value, new_value, source].hash