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.
113 114 115 116 117 118 119 120 |
# File 'lib/smplkit/config/client.rb', line 113 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.
111 112 113 |
# File 'lib/smplkit/config/client.rb', line 111 def config_id @config_id end |
#item_key ⇒ Object (readonly)
Returns the value of attribute item_key.
111 112 113 |
# File 'lib/smplkit/config/client.rb', line 111 def item_key @item_key end |
#new_value ⇒ Object (readonly)
Returns the value of attribute new_value.
111 112 113 |
# File 'lib/smplkit/config/client.rb', line 111 def new_value @new_value end |
#old_value ⇒ Object (readonly)
Returns the value of attribute old_value.
111 112 113 |
# File 'lib/smplkit/config/client.rb', line 111 def old_value @old_value end |
#source ⇒ Object (readonly)
Returns the value of attribute source.
111 112 113 |
# File 'lib/smplkit/config/client.rb', line 111 def source @source end |
Instance Method Details
#==(other) ⇒ Object Also known as: eql?
122 123 124 125 126 127 |
# File 'lib/smplkit/config/client.rb', line 122 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
130 |
# File 'lib/smplkit/config/client.rb', line 130 def hash = [config_id, item_key, old_value, new_value, source].hash |