Class: Clickwrap::Retention::Applier::Outcome

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

Overview

One line of the report. The same shape for every outcome, so a task, a test, and a job all read it the same way, and note always says in a sentence why the line is where it is.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(part:, event_id: nil, record_id: nil, policy_key: nil, note: nil) ⇒ Outcome

Returns a new instance of Outcome.



26
27
28
# File 'lib/clickwrap/retention/applier.rb', line 26

def initialize(part:, event_id: nil, record_id: nil, policy_key: nil, note: nil)
  super
end

Instance Attribute Details

#event_idObject (readonly)

Returns the value of attribute event_id

Returns:

  • (Object)

    the current value of event_id



25
26
27
# File 'lib/clickwrap/retention/applier.rb', line 25

def event_id
  @event_id
end

#noteObject (readonly)

Returns the value of attribute note

Returns:

  • (Object)

    the current value of note



25
26
27
# File 'lib/clickwrap/retention/applier.rb', line 25

def note
  @note
end

#partObject (readonly)

Returns the value of attribute part

Returns:

  • (Object)

    the current value of part



25
26
27
# File 'lib/clickwrap/retention/applier.rb', line 25

def part
  @part
end

#policy_keyObject (readonly)

Returns the value of attribute policy_key

Returns:

  • (Object)

    the current value of policy_key



25
26
27
# File 'lib/clickwrap/retention/applier.rb', line 25

def policy_key
  @policy_key
end

#record_idObject (readonly)

Returns the value of attribute record_id

Returns:

  • (Object)

    the current value of record_id



25
26
27
# File 'lib/clickwrap/retention/applier.rb', line 25

def record_id
  @record_id
end

Instance Method Details

#to_report_entryObject



30
31
32
33
34
35
36
37
38
# File 'lib/clickwrap/retention/applier.rb', line 30

def to_report_entry
  {
    "part" => part.to_s,
    "event_id" => event_id,
    "record_id" => record_id&.to_s,
    "policy_key" => policy_key,
    "note" => note
  }.compact
end