Class: Textus::Read::Audit::Query
- Inherits:
-
Data
- Object
- Data
- Textus::Read::Audit::Query
- Defined in:
- lib/textus/read/audit.rb
Overview
Value object that carries all filter parameters for an audit query. ‘matches?` checks the manifest-independent predicates so the loop body only needs to handle the zone check (which requires manifest access).
Instance Attribute Summary collapse
-
#correlation_id ⇒ Object
readonly
Returns the value of attribute correlation_id.
-
#key ⇒ Object
readonly
Returns the value of attribute key.
-
#limit ⇒ Object
readonly
Returns the value of attribute limit.
-
#role ⇒ Object
readonly
Returns the value of attribute role.
-
#seq_since ⇒ Object
readonly
Returns the value of attribute seq_since.
-
#since ⇒ Object
readonly
Returns the value of attribute since.
-
#verb ⇒ Object
readonly
Returns the value of attribute verb.
-
#zone ⇒ Object
readonly
Returns the value of attribute zone.
Class Method Summary collapse
-
.build(key: nil, zone: nil, role: nil, verb: nil, since: nil, seq_since: nil, correlation_id: nil, limit: nil) ⇒ Object
rubocop:disable Metrics/ParameterLists.
Instance Method Summary collapse
-
#matches?(row) ⇒ Boolean
rubocop:enable Metrics/ParameterLists.
Instance Attribute Details
#correlation_id ⇒ Object (readonly)
Returns the value of attribute correlation_id
13 14 15 |
# File 'lib/textus/read/audit.rb', line 13 def correlation_id @correlation_id end |
#key ⇒ Object (readonly)
Returns the value of attribute key
13 14 15 |
# File 'lib/textus/read/audit.rb', line 13 def key @key end |
#limit ⇒ Object (readonly)
Returns the value of attribute limit
13 14 15 |
# File 'lib/textus/read/audit.rb', line 13 def limit @limit end |
#role ⇒ Object (readonly)
Returns the value of attribute role
13 14 15 |
# File 'lib/textus/read/audit.rb', line 13 def role @role end |
#seq_since ⇒ Object (readonly)
Returns the value of attribute seq_since
13 14 15 |
# File 'lib/textus/read/audit.rb', line 13 def seq_since @seq_since end |
#since ⇒ Object (readonly)
Returns the value of attribute since
13 14 15 |
# File 'lib/textus/read/audit.rb', line 13 def since @since end |
#verb ⇒ Object (readonly)
Returns the value of attribute verb
13 14 15 |
# File 'lib/textus/read/audit.rb', line 13 def verb @verb end |
#zone ⇒ Object (readonly)
Returns the value of attribute zone
13 14 15 |
# File 'lib/textus/read/audit.rb', line 13 def zone @zone end |
Class Method Details
.build(key: nil, zone: nil, role: nil, verb: nil, since: nil, seq_since: nil, correlation_id: nil, limit: nil) ⇒ Object
rubocop:disable Metrics/ParameterLists
15 16 17 18 |
# File 'lib/textus/read/audit.rb', line 15 def self.build(key: nil, zone: nil, role: nil, verb: nil, since: nil, seq_since: nil, correlation_id: nil, limit: nil) new(key:, zone:, role:, verb:, since:, seq_since:, correlation_id:, limit:) end |
Instance Method Details
#matches?(row) ⇒ Boolean
rubocop:enable Metrics/ParameterLists
21 22 23 24 25 26 27 28 29 30 |
# File 'lib/textus/read/audit.rb', line 21 def matches?(row) return false if key && row["key"] != key return false if role && row["role"] != role return false if verb && row["verb"] != verb return false if since && (row["ts"].nil? || Time.parse(row["ts"]) < since) return false if seq_since && (row["seq"].nil? || row["seq"] <= seq_since) return false if correlation_id && row.dig("extras", "correlation_id") != correlation_id true end |