Class: Clickwrap::Integrity::Chain::Result

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#breaksObject (readonly)

Returns the value of attribute breaks

Returns:

  • (Object)

    the current value of breaks



59
60
61
# File 'lib/clickwrap/integrity/chain.rb', line 59

def breaks
  @breaks
end

#chaining_enabledObject (readonly)

Returns the value of attribute chaining_enabled

Returns:

  • (Object)

    the current value of chaining_enabled



59
60
61
# File 'lib/clickwrap/integrity/chain.rb', line 59

def chaining_enabled
  @chaining_enabled
end

#checkedObject (readonly)

Returns the value of attribute checked

Returns:

  • (Object)

    the current value of checked



59
60
61
# File 'lib/clickwrap/integrity/chain.rb', line 59

def checked
  @checked
end

#documented_dispositionsObject (readonly)

Returns the value of attribute documented_dispositions

Returns:

  • (Object)

    the current value of documented_dispositions



59
60
61
# File 'lib/clickwrap/integrity/chain.rb', line 59

def documented_dispositions
  @documented_dispositions
end

#scopesObject (readonly)

Returns the value of attribute scopes

Returns:

  • (Object)

    the current value of scopes



59
60
61
# File 'lib/clickwrap/integrity/chain.rb', line 59

def scopes
  @scopes
end

#started_mid_chainObject (readonly)

Returns the value of attribute started_mid_chain

Returns:

  • (Object)

    the current value of started_mid_chain



59
60
61
# File 'lib/clickwrap/integrity/chain.rb', line 59

def started_mid_chain
  @started_mid_chain
end

#verifiedObject (readonly)

Returns the value of attribute verified

Returns:

  • (Object)

    the current value of verified



59
60
61
# File 'lib/clickwrap/integrity/chain.rb', line 59

def verified
  @verified
end

Instance Method Details

#countsObject



71
72
73
74
75
76
77
78
79
# File 'lib/clickwrap/integrity/chain.rb', line 71

def counts
  {
    "checked" => checked,
    "verified" => verified,
    "documented_dispositions" => documented_dispositions,
    "breaks" => breaks.length,
    "scopes" => scopes.length
  }
end

#first_breakObject



69
# File 'lib/clickwrap/integrity/chain.rb', line 69

def first_break = breaks.first

#success?Boolean

Returns:

  • (Boolean)


68
# File 'lib/clickwrap/integrity/chain.rb', line 68

def success? = breaks.empty?

#to_hObject



81
82
83
84
85
86
87
88
89
90
91
92
93
# File 'lib/clickwrap/integrity/chain.rb', line 81

def to_h
  {
    "chaining_enabled" => chaining_enabled,
    "counts" => counts,
    "scopes" => scopes,
    "started_mid_chain" => started_mid_chain,
    "first_break" => first_break&.to_h,
    "breaks" => breaks.map(&:to_h),
    "detects" => "An event rewritten or removed after it was written, for as long as the " \
                 "chain head remains trustworthy. Not a rewrite of the events and their " \
                 "digests together by a privileged actor."
  }
end