Class: Clickwrap::Retention::Planner::Item
- Inherits:
-
Data
- Object
- Data
- Clickwrap::Retention::Planner::Item
- Defined in:
- lib/clickwrap/retention/planner.rb
Overview
One line of a plan. eligibility records which question the applier
must re-ask: a retention plan re-checks whether the rule still says the
item is due, while an actor-request plan re-checks that the item still
exists and is not held, because whether an erasure request outranks a
retention duty is a decision a human made, not one this gem can make.
Instance Attribute Summary collapse
-
#actor_reference ⇒ Object
readonly
Returns the value of attribute actor_reference.
-
#detail ⇒ Object
readonly
Returns the value of attribute detail.
-
#eligibility ⇒ Object
readonly
Returns the value of attribute eligibility.
-
#eligible_at ⇒ Object
readonly
Returns the value of attribute eligible_at.
-
#event_id ⇒ Object
readonly
Returns the value of attribute event_id.
-
#part ⇒ Object
readonly
Returns the value of attribute part.
-
#policy_key ⇒ Object
readonly
Returns the value of attribute policy_key.
-
#record_id ⇒ Object
readonly
Returns the value of attribute record_id.
-
#retention_class_key ⇒ Object
readonly
Returns the value of attribute retention_class_key.
-
#rule ⇒ Object
readonly
Returns the value of attribute rule.
-
#status ⇒ Object
readonly
Returns the value of attribute status.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(part:, status:, event_id: nil, record_id: nil, policy_key: nil, actor_reference: nil, retention_class_key: nil, eligible_at: nil, rule: nil, detail: nil, eligibility: "retention") ⇒ Item
constructor
A new instance of Item.
- #to_plan_entry ⇒ Object
Constructor Details
#initialize(part:, status:, event_id: nil, record_id: nil, policy_key: nil, actor_reference: nil, retention_class_key: nil, eligible_at: nil, rule: nil, detail: nil, eligibility: "retention") ⇒ Item
Returns a new instance of Item.
67 68 69 70 71 |
# File 'lib/clickwrap/retention/planner.rb', line 67 def initialize(part:, status:, event_id: nil, record_id: nil, policy_key: nil, actor_reference: nil, retention_class_key: nil, eligible_at: nil, rule: nil, detail: nil, eligibility: "retention") super end |
Instance Attribute Details
#actor_reference ⇒ Object (readonly)
Returns the value of attribute actor_reference
65 66 67 |
# File 'lib/clickwrap/retention/planner.rb', line 65 def actor_reference @actor_reference end |
#detail ⇒ Object (readonly)
Returns the value of attribute detail
65 66 67 |
# File 'lib/clickwrap/retention/planner.rb', line 65 def detail @detail end |
#eligibility ⇒ Object (readonly)
Returns the value of attribute eligibility
65 66 67 |
# File 'lib/clickwrap/retention/planner.rb', line 65 def eligibility @eligibility end |
#eligible_at ⇒ Object (readonly)
Returns the value of attribute eligible_at
65 66 67 |
# File 'lib/clickwrap/retention/planner.rb', line 65 def eligible_at @eligible_at end |
#event_id ⇒ Object (readonly)
Returns the value of attribute event_id
65 66 67 |
# File 'lib/clickwrap/retention/planner.rb', line 65 def event_id @event_id end |
#part ⇒ Object (readonly)
Returns the value of attribute part
65 66 67 |
# File 'lib/clickwrap/retention/planner.rb', line 65 def part @part end |
#policy_key ⇒ Object (readonly)
Returns the value of attribute policy_key
65 66 67 |
# File 'lib/clickwrap/retention/planner.rb', line 65 def policy_key @policy_key end |
#record_id ⇒ Object (readonly)
Returns the value of attribute record_id
65 66 67 |
# File 'lib/clickwrap/retention/planner.rb', line 65 def record_id @record_id end |
#retention_class_key ⇒ Object (readonly)
Returns the value of attribute retention_class_key
65 66 67 |
# File 'lib/clickwrap/retention/planner.rb', line 65 def retention_class_key @retention_class_key end |
#rule ⇒ Object (readonly)
Returns the value of attribute rule
65 66 67 |
# File 'lib/clickwrap/retention/planner.rb', line 65 def rule @rule end |
#status ⇒ Object (readonly)
Returns the value of attribute status
65 66 67 |
# File 'lib/clickwrap/retention/planner.rb', line 65 def status @status end |
Class Method Details
.from_plan_entry(entry) ⇒ Object
89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 |
# File 'lib/clickwrap/retention/planner.rb', line 89 def self.from_plan_entry(entry) entry = entry.to_h new( part: entry["part"].to_s.to_sym, status: entry["status"].to_s.to_sym, event_id: entry["event_id"], record_id: entry["record_id"], policy_key: entry["policy_key"], actor_reference: entry["actor_reference"], retention_class_key: entry["retention_class"], rule: entry["rule"], detail: entry["detail"], eligibility: entry["eligibility"] || "retention" ) end |
Instance Method Details
#to_plan_entry ⇒ Object
73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 |
# File 'lib/clickwrap/retention/planner.rb', line 73 def to_plan_entry { "part" => part.to_s, "status" => status.to_s, "event_id" => event_id, "record_id" => record_id&.to_s, "policy_key" => policy_key, "actor_reference" => actor_reference, "retention_class" => retention_class_key, "eligible_at" => eligible_at && Receipt.format_time(eligible_at), "rule" => rule, "detail" => detail, "eligibility" => eligibility }.compact end |