Class: Sqreen::RequestRecord
- Defined in:
- lib/sqreen/events/request_record.rb
Overview
When a request is deeemed worthy of being sent to the backend
Instance Attribute Summary collapse
-
#redactor ⇒ Object
readonly
Returns the value of attribute redactor.
Attributes inherited from Event
Instance Method Summary collapse
-
#initialize(payload, redactor = nil) ⇒ RequestRecord
constructor
A new instance of RequestRecord.
- #last_identify_args ⇒ Object
- #observed ⇒ Object
- #processed_sdk_calls ⇒ Object
Methods inherited from Event
Constructor Details
#initialize(payload, redactor = nil) ⇒ RequestRecord
Returns a new instance of RequestRecord.
20 21 22 23 |
# File 'lib/sqreen/events/request_record.rb', line 20 def initialize(payload, redactor = nil) @redactor = redactor super(payload) end |
Instance Attribute Details
#redactor ⇒ Object (readonly)
Returns the value of attribute redactor.
16 17 18 |
# File 'lib/sqreen/events/request_record.rb', line 16 def redactor @redactor end |
Instance Method Details
#last_identify_args ⇒ Object
29 30 31 32 33 34 35 36 37 |
# File 'lib/sqreen/events/request_record.rb', line 29 def last_identify_args return nil unless observed[:sdk] observed[:sdk].reverse_each do |meth, _time, *args| next unless meth == :identify return args end nil end |
#observed ⇒ Object
25 26 27 |
# File 'lib/sqreen/events/request_record.rb', line 25 def observed (payload && payload[:observed]) || {} end |
#processed_sdk_calls ⇒ Object
39 40 41 42 43 44 45 46 47 48 49 50 |
# File 'lib/sqreen/events/request_record.rb', line 39 def processed_sdk_calls return [] unless observed[:sdk] auth_keys = last_identify_id observed[:sdk].map do |meth, time, *args| { :name => meth, :time => time, :args => inject_identifiers(args, meth, auth_keys), } end end |