Class: Smplkit::Config::ConfigChangeEvent
- Inherits:
-
Object
- Object
- Smplkit::Config::ConfigChangeEvent
- Defined in:
- lib/smplkit/config/client.rb
Overview
Describes a config change event delivered to on_change listeners.
Instance Attribute Summary collapse
-
#deleted ⇒ Object
readonly
Returns the value of attribute deleted.
-
#key ⇒ Object
readonly
Returns the value of attribute key.
-
#source ⇒ Object
readonly
Returns the value of attribute source.
Instance Method Summary collapse
- #==(other) ⇒ Object (also: #eql?)
- #deleted? ⇒ Boolean
- #hash ⇒ Object
-
#initialize(key:, source:, deleted: false) ⇒ ConfigChangeEvent
constructor
A new instance of ConfigChangeEvent.
Constructor Details
#initialize(key:, source:, deleted: false) ⇒ ConfigChangeEvent
Returns a new instance of ConfigChangeEvent.
9 10 11 12 13 14 |
# File 'lib/smplkit/config/client.rb', line 9 def initialize(key:, source:, deleted: false) @key = key @source = source @deleted = deleted freeze end |
Instance Attribute Details
#deleted ⇒ Object (readonly)
Returns the value of attribute deleted.
7 8 9 |
# File 'lib/smplkit/config/client.rb', line 7 def deleted @deleted end |
#key ⇒ Object (readonly)
Returns the value of attribute key.
7 8 9 |
# File 'lib/smplkit/config/client.rb', line 7 def key @key end |
#source ⇒ Object (readonly)
Returns the value of attribute source.
7 8 9 |
# File 'lib/smplkit/config/client.rb', line 7 def source @source end |
Instance Method Details
#==(other) ⇒ Object Also known as: eql?
18 19 20 |
# File 'lib/smplkit/config/client.rb', line 18 def ==(other) other.is_a?(ConfigChangeEvent) && key == other.key && source == other.source && deleted == other.deleted end |
#deleted? ⇒ Boolean
16 |
# File 'lib/smplkit/config/client.rb', line 16 def deleted? = @deleted |
#hash ⇒ Object
23 |
# File 'lib/smplkit/config/client.rb', line 23 def hash = [key, source, deleted].hash |