Class: Clickwrap::Integrity::AttestationReconciler::Result

Inherits:
Data
  • Object
show all
Defined in:
lib/clickwrap/integrity/attestation_reconciler.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#outcomesObject (readonly)

Returns the value of attribute outcomes

Returns:

  • (Object)

    the current value of outcomes



30
31
32
# File 'lib/clickwrap/integrity/attestation_reconciler.rb', line 30

def outcomes
  @outcomes
end

Instance Method Details

#attemptedObject



31
# File 'lib/clickwrap/integrity/attestation_reconciler.rb', line 31

def attempted = outcomes.length

#clean?Boolean

Returns:

  • (Boolean)


39
# File 'lib/clickwrap/integrity/attestation_reconciler.rb', line 39

def clean? = not_recorded.zero?

#countsObject



35
36
37
# File 'lib/clickwrap/integrity/attestation_reconciler.rb', line 35

def counts
  { "attempted" => attempted, "recorded" => recorded, "not_recorded" => not_recorded }
end

#not_recordedObject



33
# File 'lib/clickwrap/integrity/attestation_reconciler.rb', line 33

def not_recorded = attempted - recorded

#recordedObject



32
# File 'lib/clickwrap/integrity/attestation_reconciler.rb', line 32

def recorded = outcomes.count(&:recorded?)

#to_hObject



40
# File 'lib/clickwrap/integrity/attestation_reconciler.rb', line 40

def to_h = { "counts" => counts, "outcomes" => outcomes.map(&:to_h) }