class KeySet::None

Public Class Methods

class_sort_index() click to toggle source
# File lib/key_set/none.rb, line 5
def self.class_sort_index
  0
end

Public Instance Methods

intersect(other) click to toggle source
# File lib/key_set/none.rb, line 37
def intersect(other)
  case other
  when All
    KeySet.none
  when None
    KeySet.none
  when Some
    KeySet.none
  when AllExceptSome
    KeySet.none
  else
    raise ArgumentError, 'it needs a valid KeySet'
  end
end
invert() click to toggle source
# File lib/key_set/none.rb, line 13
def invert
  KeySet.all
end
remove(other) click to toggle source
# File lib/key_set/none.rb, line 17
def remove(other)
  case other
  when All
    # we have nothing, we remove everything => we have nothing
    KeySet.none
  when None
    # we have nothing, we remove nothing => we have nothing
    KeySet.none
  when Some
    # we have nothing, we remove some => we have nothing
    KeySet.none
  when AllExceptSome
    # we have nothing, we remove all except some => we have nothing
    KeySet.logger.warn "KeySet removing AllButSome, probably a mistake. this: NONE, removing keys: #{other.keys.inspect}"
    KeySet.none
  else
    raise ArgumentError, 'it needs a valid KeySet'
  end
end
represents_none?() click to toggle source
# File lib/key_set/none.rb, line 9
def represents_none?
  true
end