Class: FlipperTrail::Entry
- Inherits:
-
Struct
- Object
- Struct
- FlipperTrail::Entry
- Defined in:
- lib/flipper_trail/entry.rb
Overview
An immutable record of a single feature-flag change: which feature and gate, the operation, the before/after state, the Actor, and when it happened.
Instance Attribute Summary collapse
-
#actor ⇒ Actor?
Who made the change.
-
#after ⇒ Object
The gate state after the change.
-
#before ⇒ Object
The gate state before the change.
-
#created_at ⇒ Time
When the change was recorded.
-
#feature_name ⇒ String
The feature key.
-
#gate_name ⇒ String?
The gate affected, if any.
-
#operation ⇒ Symbol
The write performed (‘:add`, `:remove`, `:clear`, `:enable`, `:disable`).
Instance Method Summary collapse
-
#changed? ⇒ Boolean
Whether the change altered the feature’s state.
Instance Attribute Details
#actor ⇒ Actor?
Returns who made the change.
22 23 24 25 26 27 28 29 30 |
# File 'lib/flipper_trail/entry.rb', line 22 Entry = Struct.new( :feature_name, :operation, :gate_name, :before, :after, :actor, :created_at, keyword_init: true ) do # @return [Boolean] whether the change altered the feature's state def changed? before != after end end |
#after ⇒ Object
Returns the gate state after the change.
22 23 24 25 26 27 28 29 30 |
# File 'lib/flipper_trail/entry.rb', line 22 Entry = Struct.new( :feature_name, :operation, :gate_name, :before, :after, :actor, :created_at, keyword_init: true ) do # @return [Boolean] whether the change altered the feature's state def changed? before != after end end |
#before ⇒ Object
Returns the gate state before the change.
22 23 24 25 26 27 28 29 30 |
# File 'lib/flipper_trail/entry.rb', line 22 Entry = Struct.new( :feature_name, :operation, :gate_name, :before, :after, :actor, :created_at, keyword_init: true ) do # @return [Boolean] whether the change altered the feature's state def changed? before != after end end |
#created_at ⇒ Time
Returns when the change was recorded.
22 23 24 25 26 27 28 29 30 |
# File 'lib/flipper_trail/entry.rb', line 22 Entry = Struct.new( :feature_name, :operation, :gate_name, :before, :after, :actor, :created_at, keyword_init: true ) do # @return [Boolean] whether the change altered the feature's state def changed? before != after end end |
#feature_name ⇒ String
Returns the feature key.
22 23 24 25 26 27 28 29 30 |
# File 'lib/flipper_trail/entry.rb', line 22 Entry = Struct.new( :feature_name, :operation, :gate_name, :before, :after, :actor, :created_at, keyword_init: true ) do # @return [Boolean] whether the change altered the feature's state def changed? before != after end end |
#gate_name ⇒ String?
Returns the gate affected, if any.
22 23 24 25 26 27 28 29 30 |
# File 'lib/flipper_trail/entry.rb', line 22 Entry = Struct.new( :feature_name, :operation, :gate_name, :before, :after, :actor, :created_at, keyword_init: true ) do # @return [Boolean] whether the change altered the feature's state def changed? before != after end end |
#operation ⇒ Symbol
Returns the write performed (‘:add`, `:remove`, `:clear`, `:enable`, `:disable`).
22 23 24 25 26 27 28 29 30 |
# File 'lib/flipper_trail/entry.rb', line 22 Entry = Struct.new( :feature_name, :operation, :gate_name, :before, :after, :actor, :created_at, keyword_init: true ) do # @return [Boolean] whether the change altered the feature's state def changed? before != after end end |
Instance Method Details
#changed? ⇒ Boolean
Returns whether the change altered the feature’s state.
27 28 29 |
# File 'lib/flipper_trail/entry.rb', line 27 def changed? before != after end |