Class: FiberAudit::Runtime::ActiveOperations::Snapshot
- Inherits:
-
Data
- Object
- Data
- FiberAudit::Runtime::ActiveOperations::Snapshot
- Defined in:
- lib/fiber_audit/runtime/active_operations.rb
Instance Attribute Summary collapse
-
#entries ⇒ Object
readonly
Returns the value of attribute entries.
-
#total_count ⇒ Object
readonly
Returns the value of attribute total_count.
Instance Method Summary collapse
-
#initialize(entries:, total_count:) ⇒ Snapshot
constructor
A new instance of Snapshot.
- #truncated? ⇒ Boolean
Constructor Details
#initialize(entries:, total_count:) ⇒ Snapshot
Returns a new instance of Snapshot.
27 28 29 30 31 32 33 34 35 36 |
# File 'lib/fiber_audit/runtime/active_operations.rb', line 27 def initialize(entries:, total_count:) unless entries.is_a?(Array) && entries.all?(Entry) raise RuntimeContractError, 'snapshot entries must be ActiveOperations::Entry values' end super( entries: entries.dup.freeze, total_count: Validation.integer(total_count, 'active operation total count') ) end |
Instance Attribute Details
#entries ⇒ Object (readonly)
Returns the value of attribute entries
26 27 28 |
# File 'lib/fiber_audit/runtime/active_operations.rb', line 26 def entries @entries end |
#total_count ⇒ Object (readonly)
Returns the value of attribute total_count
26 27 28 |
# File 'lib/fiber_audit/runtime/active_operations.rb', line 26 def total_count @total_count end |
Instance Method Details
#truncated? ⇒ Boolean
38 |
# File 'lib/fiber_audit/runtime/active_operations.rb', line 38 def truncated? = total_count > entries.size |