Class: Smplkit::Config::ConfigChangeEvent
- Inherits:
-
Object
- Object
- Smplkit::Config::ConfigChangeEvent
- 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
-
#config_id ⇒ Object
readonly
Returns the value of attribute config_id.
-
#item_key ⇒ Object
readonly
Returns the value of attribute item_key.
-
#new_value ⇒ Object
readonly
Returns the value of attribute new_value.
-
#old_value ⇒ Object
readonly
Returns the value of attribute old_value.
-
#source ⇒ Object
readonly
Returns the value of attribute source.
Instance Method Summary collapse
- #==(other) ⇒ Object (also: #eql?)
- #hash ⇒ Object
-
#initialize(config_id:, item_key:, old_value:, new_value:, source:) ⇒ ConfigChangeEvent
constructor
A new instance of ConfigChangeEvent.
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_id ⇒ Object (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_key ⇒ Object (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_value ⇒ Object (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_value ⇒ Object (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 |
#source ⇒ Object (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 |
#hash ⇒ Object
205 |
# File 'lib/smplkit/config/client.rb', line 205 def hash = [config_id, item_key, old_value, new_value, source].hash |