Class: Clickwrap::RequestEvidenceExtractor::Resolved

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

Overview

What one extraction produced.

attributes is the exact attribute hash for a clickwrap_request_evidence row, minus event_id and created_at, which the writer supplies once the event has an identifier. authorized_fields is the same manifest that travels in the row: the list of what the server-owned policy ALLOWED, which is a different and more useful fact than what happens to be present. A country column that is blank because the policy never authorized a country reads nothing like one that is blank because a provider had no answer, and the manifest is what keeps them apart.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes: {}, authorized_fields: {}, records_anything: false) ⇒ Resolved

Returns a new instance of Resolved.



49
50
51
# File 'lib/clickwrap/request_evidence_extractor.rb', line 49

def initialize(attributes: {}, authorized_fields: {}, records_anything: false)
  super
end

Instance Attribute Details

#attributesObject (readonly)

Returns the value of attribute attributes

Returns:

  • (Object)

    the current value of attributes



48
49
50
# File 'lib/clickwrap/request_evidence_extractor.rb', line 48

def attributes
  @attributes
end

#authorized_fieldsObject (readonly)

Returns the value of attribute authorized_fields

Returns:

  • (Object)

    the current value of authorized_fields



48
49
50
# File 'lib/clickwrap/request_evidence_extractor.rb', line 48

def authorized_fields
  @authorized_fields
end

#records_anythingObject (readonly)

Returns the value of attribute records_anything

Returns:

  • (Object)

    the current value of records_anything



48
49
50
# File 'lib/clickwrap/request_evidence_extractor.rb', line 48

def records_anything
  @records_anything
end

Class Method Details

.none(authorized_fields:) ⇒ Object

This policy records nothing about the request. No row is written at all — an empty annex row would be indistinguishable from one whose fields were later deleted under a retention rule.



58
59
60
# File 'lib/clickwrap/request_evidence_extractor.rb', line 58

def self.none(authorized_fields:)
  new(attributes: {}, authorized_fields: authorized_fields, records_anything: false)
end

Instance Method Details

#records_anything?Boolean

Returns:

  • (Boolean)


53
# File 'lib/clickwrap/request_evidence_extractor.rb', line 53

def records_anything? = records_anything == true