Sha256: 8d94699ac5472c09497137f3cbce817381ba0d84c5c8c6b765d72b232900bd01
Contents?: true
Size: 687 Bytes
Versions: 55
Compression:
Stored size: 687 Bytes
Contents
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
55 entries across 55 versions & 1 rubygems