Class: Clickwrap::Retention::Planner::Eligibility

Inherits:
Data
  • Object
show all
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

Instance Method Summary collapse

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_atObject (readonly)

Returns the value of attribute eligible_at

Returns:

  • (Object)

    the current value of eligible_at



50
51
52
# File 'lib/clickwrap/retention/planner.rb', line 50

def eligible_at
  @eligible_at
end

#ruleObject (readonly)

Returns the value of attribute rule

Returns:

  • (Object)

    the current value of rule



50
51
52
# File 'lib/clickwrap/retention/planner.rb', line 50

def rule
  @rule
end

#unresolved_reasonObject (readonly)

Returns the value of attribute unresolved_reason

Returns:

  • (Object)

    the current value of 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

Returns:

  • (Boolean)


57
# File 'lib/clickwrap/retention/planner.rb', line 57

def due?(at) = resolved? && eligible_at <= at

#resolved?Boolean

Returns:

  • (Boolean)


55
# File 'lib/clickwrap/retention/planner.rb', line 55

def resolved? = !eligible_at.nil?

#unresolved?Boolean

Returns:

  • (Boolean)


56
# File 'lib/clickwrap/retention/planner.rb', line 56

def unresolved? = eligible_at.nil?