Class: Clickwrap::Retention::Planner::Eligibility
- Inherits:
-
Data
- Object
- Data
- Clickwrap::Retention::Planner::Eligibility
- Defined in:
- lib/clickwrap/retention/planner.rb
Overview
What a rule currently says about one part, with "we cannot say yet" kept as a first-class answer rather than folded into a date.
Instance Attribute Summary collapse
-
#eligible_at ⇒ Object
readonly
Returns the value of attribute eligible_at.
-
#rule ⇒ Object
readonly
Returns the value of attribute rule.
-
#unresolved_reason ⇒ Object
readonly
Returns the value of attribute unresolved_reason.
Instance Method Summary collapse
- #due?(at) ⇒ Boolean
-
#initialize(eligible_at: nil, rule: nil, unresolved_reason: nil) ⇒ Eligibility
constructor
A new instance of Eligibility.
- #resolved? ⇒ Boolean
- #unresolved? ⇒ Boolean
Constructor Details
#initialize(eligible_at: nil, rule: nil, unresolved_reason: nil) ⇒ Eligibility
Returns a new instance of Eligibility.
51 52 53 |
# File 'lib/clickwrap/retention/planner.rb', line 51 def initialize(eligible_at: nil, rule: nil, unresolved_reason: nil) super end |
Instance Attribute Details
#eligible_at ⇒ Object (readonly)
Returns the value of attribute eligible_at
50 51 52 |
# File 'lib/clickwrap/retention/planner.rb', line 50 def eligible_at @eligible_at end |
#rule ⇒ Object (readonly)
Returns the value of attribute rule
50 51 52 |
# File 'lib/clickwrap/retention/planner.rb', line 50 def rule @rule end |
#unresolved_reason ⇒ Object (readonly)
Returns the value of attribute unresolved_reason
50 51 52 |
# File 'lib/clickwrap/retention/planner.rb', line 50 def unresolved_reason @unresolved_reason end |
Instance Method Details
#due?(at) ⇒ Boolean
57 |
# File 'lib/clickwrap/retention/planner.rb', line 57 def due?(at) = resolved? && eligible_at <= at |
#resolved? ⇒ Boolean
55 |
# File 'lib/clickwrap/retention/planner.rb', line 55 def resolved? = !eligible_at.nil? |
#unresolved? ⇒ Boolean
56 |
# File 'lib/clickwrap/retention/planner.rb', line 56 def unresolved? = eligible_at.nil? |