Sha256: caddb550f46bacc3833c74a1ca01c230db2a139107324d72878676be3e2131a2
Contents?: true
Size: 609 Bytes
Versions: 19
Compression:
Stored size: 609 Bytes
Contents
# frozen_string_literal: true class Gutentag::ChangeState attr_reader :taggable attr_writer :normaliser def initialize(taggable) @taggable = taggable @existing = normalised taggable.tags.collect(&:name) @changes = normalised taggable.tag_names end def added @added ||= changes - existing end def removed @removed ||= existing - changes end private attr_reader :existing, :changes def normalised(names) names.collect { |name| normaliser.call(name) }.uniq end def normaliser @normaliser ||= proc { |name| Gutentag.normaliser.call(name) } end end
Version data entries
19 entries across 19 versions & 1 rubygems