Sha256: 7426616dd828c16f8913d1a02682c3ce69a3ec4bd7b12a25fc48043ddf77cefb

Contents?: true

Size: 427 Bytes

Versions: 1

Compression:

Stored size: 427 Bytes

Contents

# frozen_string_literal: true

require "classlist/operation"

# Classlist::Remove is an operation that removes tokens from the original
# classlist when added to it.
class Classlist::Remove < Classlist::Operation
  def merge(original)
    original.entries - entries
  end

  # #resolve changes the original classlist
  def resolve(original)
    entries.each do |entry|
      original.remove(entry)
    end

    super
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
classlist-1.1.0 lib/classlist/remove.rb