Class: FiberAudit::Runtime::ActiveOperations::Snapshot

Inherits:
Data
  • Object
show all
Defined in:
lib/fiber_audit/runtime/active_operations.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#entriesObject (readonly)

Returns the value of attribute entries

Returns:

  • (Object)

    the current value of entries



26
27
28
# File 'lib/fiber_audit/runtime/active_operations.rb', line 26

def entries
  @entries
end

#total_countObject (readonly)

Returns the value of attribute total_count

Returns:

  • (Object)

    the current value of 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

Returns:

  • (Boolean)


38
# File 'lib/fiber_audit/runtime/active_operations.rb', line 38

def truncated? = total_count > entries.size