Sha256: 24e919ab4dd4e56453d3d2f3c108d385884b131424bacaff0651e5529a41bee1
Contents?: true
Size: 717 Bytes
Versions: 13
Compression:
Stored size: 717 Bytes
Contents
# frozen_string_literal: true module ThinkFeelDoEngine # Simplifies the logic of the conditions to display a thought viz class HarmfulThoughtVizPresenter TOO_FEW_THOUGHTS = 2 attr_reader :pattern_ids def initialize(harmful_thought_ids) @pattern_ids = harmful_thought_ids end def display_viz? uniq_pattern_ids .select { |id| compacted_pattern_ids.count(id) > TOO_FEW_THOUGHTS } .present? end private def compacted_pattern_ids @compacted_pattern_ids ||= pattern_ids .compact end def uniq_pattern_ids @uniq_pattern_ids ||= compacted_pattern_ids .uniq end end end
Version data entries
13 entries across 13 versions & 1 rubygems