Class: Igniter::Lang::ReceiptPayload
- Inherits:
-
Object
- Object
- Igniter::Lang::ReceiptPayload
- Defined in:
- lib/igniter/lang/receipt_payload.rb
Constant Summary collapse
- SEMANTICS =
{ report_only: true, runtime_enforced: false, execution_authorized: false, operation_execution_authorized: false, external_bridge_authorized: false, provider_call_authorized: false, real_data_export_authorized: false, ledger_core: false }.freeze
- DEFAULT_REDACTION_POLICY =
{ raw_ref_export: false, hash_source_refs: true, redacted_ref_kinds: [] }.freeze
- RAW_REF_KEYS =
%i[raw_ref raw_refs raw_source_ref raw_source_refs].freeze
- RAW_REF_PREFIX =
"raw:"
Instance Attribute Summary collapse
-
#evidence_links ⇒ Object
readonly
Returns the value of attribute evidence_links.
-
#metadata ⇒ Object
readonly
Returns the value of attribute metadata.
-
#payload ⇒ Object
readonly
Returns the value of attribute payload.
-
#profile ⇒ Object
readonly
Returns the value of attribute profile.
-
#receipt_id ⇒ Object
readonly
Returns the value of attribute receipt_id.
-
#redaction_policy ⇒ Object
readonly
Returns the value of attribute redaction_policy.
Instance Method Summary collapse
-
#initialize(receipt_id:, profile:, payload: {}, evidence_links: {}, redaction_policy: {}, metadata: {}) ⇒ ReceiptPayload
constructor
A new instance of ReceiptPayload.
- #report_only? ⇒ Boolean
- #runtime_enforced? ⇒ Boolean
- #to_h ⇒ Object
Constructor Details
#initialize(receipt_id:, profile:, payload: {}, evidence_links: {}, redaction_policy: {}, metadata: {}) ⇒ ReceiptPayload
Returns a new instance of ReceiptPayload.
33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 |
# File 'lib/igniter/lang/receipt_payload.rb', line 33 def initialize( receipt_id:, profile:, payload: {}, evidence_links: {}, redaction_policy: {}, metadata: {} ) @receipt_id = require_value(:receipt_id, receipt_id) @profile = require_value(:profile, profile) @payload = deep_freeze(normalize_hash(payload, :payload)) @evidence_links = deep_freeze(normalize_hash(evidence_links, :evidence_links)) @redaction_policy = deep_freeze(normalize_redaction_policy(redaction_policy)) @metadata = deep_freeze(normalize_hash(, :metadata)) reject_raw_refs! freeze end |
Instance Attribute Details
#evidence_links ⇒ Object (readonly)
Returns the value of attribute evidence_links.
26 27 28 |
# File 'lib/igniter/lang/receipt_payload.rb', line 26 def evidence_links @evidence_links end |
#metadata ⇒ Object (readonly)
Returns the value of attribute metadata.
26 27 28 |
# File 'lib/igniter/lang/receipt_payload.rb', line 26 def @metadata end |
#payload ⇒ Object (readonly)
Returns the value of attribute payload.
26 27 28 |
# File 'lib/igniter/lang/receipt_payload.rb', line 26 def payload @payload end |
#profile ⇒ Object (readonly)
Returns the value of attribute profile.
26 27 28 |
# File 'lib/igniter/lang/receipt_payload.rb', line 26 def profile @profile end |
#receipt_id ⇒ Object (readonly)
Returns the value of attribute receipt_id.
26 27 28 |
# File 'lib/igniter/lang/receipt_payload.rb', line 26 def receipt_id @receipt_id end |
#redaction_policy ⇒ Object (readonly)
Returns the value of attribute redaction_policy.
26 27 28 |
# File 'lib/igniter/lang/receipt_payload.rb', line 26 def redaction_policy @redaction_policy end |
Instance Method Details
#report_only? ⇒ Boolean
51 52 53 |
# File 'lib/igniter/lang/receipt_payload.rb', line 51 def report_only? true end |
#runtime_enforced? ⇒ Boolean
55 56 57 |
# File 'lib/igniter/lang/receipt_payload.rb', line 55 def runtime_enforced? false end |
#to_h ⇒ Object
59 60 61 62 63 64 65 66 67 68 69 |
# File 'lib/igniter/lang/receipt_payload.rb', line 59 def to_h { receipt_id: receipt_id, profile: profile, payload: payload, evidence_links: evidence_links, redaction_policy: redaction_policy, semantics: SEMANTICS, metadata: } end |