Class: Parse::Webhooks::TriggerAudit::ClassAudit
- Inherits:
-
Object
- Object
- Parse::Webhooks::TriggerAudit::ClassAudit
- Defined in:
- lib/parse/webhooks/trigger_audit.rb
Overview
Per-class audit row.
Instance Attribute Summary collapse
-
#callbacks ⇒ Hash{Symbol=>Array<Hash>}
readonly
App-defined callbacks keyed by local trigger-ish name (
:before_save,:after_create, ...). -
#findings ⇒ Array<Hash>
readonly
Findings for this class.
-
#local_routes ⇒ Array<Symbol>
readonly
Local trigger names that have a registered webhook block/route for this class (or via the
*wildcard route). -
#modeled ⇒ Boolean
readonly
Whether a loaded Parse::Object subclass models this class.
-
#parse_class ⇒ String
readonly
The Parse class name (e.g. "Post", "_User", "*").
-
#server_triggers ⇒ Hash{Symbol=>String}
readonly
Server-registered triggers for this class, mapped trigger-name => url.
Instance Method Summary collapse
-
#initialize(parse_class:, callbacks:, local_routes:, server_triggers:, findings:, modeled:) ⇒ ClassAudit
constructor
A new instance of ClassAudit.
-
#issues? ⇒ Boolean
True when the class has at least one finding.
-
#to_h ⇒ Hash
A JSON-safe representation of this row.
Constructor Details
#initialize(parse_class:, callbacks:, local_routes:, server_triggers:, findings:, modeled:) ⇒ ClassAudit
Returns a new instance of ClassAudit.
105 106 107 108 109 110 111 112 113 |
# File 'lib/parse/webhooks/trigger_audit.rb', line 105 def initialize(parse_class:, callbacks:, local_routes:, server_triggers:, findings:, modeled:) @parse_class = parse_class @callbacks = callbacks @local_routes = local_routes @server_triggers = server_triggers @findings = findings @modeled = modeled end |
Instance Attribute Details
#callbacks ⇒ Hash{Symbol=>Array<Hash>} (readonly)
Returns app-defined callbacks keyed by local
trigger-ish name (:before_save, :after_create, ...). Each value is
an array of { name:, source: }.
92 93 94 |
# File 'lib/parse/webhooks/trigger_audit.rb', line 92 def callbacks @callbacks end |
#findings ⇒ Array<Hash> (readonly)
Returns findings for this class. See Parse::Webhooks::TriggerAudit for the finding kinds.
101 102 103 |
# File 'lib/parse/webhooks/trigger_audit.rb', line 101 def findings @findings end |
#local_routes ⇒ Array<Symbol> (readonly)
Returns local trigger names that have a registered
webhook block/route for this class (or via the * wildcard route).
95 96 97 |
# File 'lib/parse/webhooks/trigger_audit.rb', line 95 def local_routes @local_routes end |
#modeled ⇒ Boolean (readonly)
Returns whether a loaded Parse::Object subclass models this class.
103 104 105 |
# File 'lib/parse/webhooks/trigger_audit.rb', line 103 def modeled @modeled end |
#parse_class ⇒ String (readonly)
Returns the Parse class name (e.g. "Post", "_User", "*").
88 89 90 |
# File 'lib/parse/webhooks/trigger_audit.rb', line 88 def parse_class @parse_class end |
Instance Method Details
#issues? ⇒ Boolean
Returns true when the class has at least one finding.
116 117 118 |
# File 'lib/parse/webhooks/trigger_audit.rb', line 116 def issues? @findings.any? end |
#to_h ⇒ Hash
Returns a JSON-safe representation of this row.
121 122 123 124 125 126 127 128 129 130 |
# File 'lib/parse/webhooks/trigger_audit.rb', line 121 def to_h { parse_class: parse_class, modeled: modeled, callbacks: callbacks, local_routes: local_routes, server_triggers: server_triggers, findings: findings, } end |