Class: Textus::Action::Audit::Query
- Inherits:
-
Data
- Object
- Data
- Textus::Action::Audit::Query
- Defined in:
- lib/textus/action/audit.rb
Instance Attribute Summary collapse
-
#correlation_id ⇒ Object
readonly
Returns the value of attribute correlation_id.
-
#key ⇒ Object
readonly
Returns the value of attribute key.
-
#lane ⇒ Object
readonly
Returns the value of attribute lane.
-
#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.
Class Method Summary collapse
-
.build(key: nil, lane: 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
76 77 78 |
# File 'lib/textus/action/audit.rb', line 76 def correlation_id @correlation_id end |
#key ⇒ Object (readonly)
Returns the value of attribute key
76 77 78 |
# File 'lib/textus/action/audit.rb', line 76 def key @key end |
#lane ⇒ Object (readonly)
Returns the value of attribute lane
76 77 78 |
# File 'lib/textus/action/audit.rb', line 76 def lane @lane end |
#limit ⇒ Object (readonly)
Returns the value of attribute limit
76 77 78 |
# File 'lib/textus/action/audit.rb', line 76 def limit @limit end |
#role ⇒ Object (readonly)
Returns the value of attribute role
76 77 78 |
# File 'lib/textus/action/audit.rb', line 76 def role @role end |
#seq_since ⇒ Object (readonly)
Returns the value of attribute seq_since
76 77 78 |
# File 'lib/textus/action/audit.rb', line 76 def seq_since @seq_since end |
#since ⇒ Object (readonly)
Returns the value of attribute since
76 77 78 |
# File 'lib/textus/action/audit.rb', line 76 def since @since end |
#verb ⇒ Object (readonly)
Returns the value of attribute verb
76 77 78 |
# File 'lib/textus/action/audit.rb', line 76 def verb @verb end |
Class Method Details
.build(key: nil, lane: nil, role: nil, verb: nil, since: nil, seq_since: nil, correlation_id: nil, limit: nil) ⇒ Object
rubocop:disable Metrics/ParameterLists
78 79 80 81 |
# File 'lib/textus/action/audit.rb', line 78 def self.build(key: nil, lane: nil, role: nil, verb: nil, since: nil, seq_since: nil, correlation_id: nil, limit: nil) new(key:, lane:, role:, verb:, since:, seq_since:, correlation_id:, limit:) end |
Instance Method Details
#matches?(row) ⇒ Boolean
rubocop:enable Metrics/ParameterLists
84 85 86 87 88 89 90 91 92 93 |
# File 'lib/textus/action/audit.rb', line 84 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 |