Class: KeySet::All
Constant Summary
Constants inherited
from KeySet
VERSION
Class Method Summary
collapse
Instance Method Summary
collapse
Methods inherited from KeySet
#<=>, #==, #===, all, all_except_some, default_logger, #eql?, #hash, logger, none, #represents_none?, some
Class Method Details
.class_sort_index ⇒ Object
5
6
7
|
# File 'lib/key_set/all.rb', line 5
def self.class_sort_index
3
end
|
Instance Method Details
#intersect(other) ⇒ Object
37
38
39
40
41
42
43
44
45
46
47
48
49
50
|
# File 'lib/key_set/all.rb', line 37
def intersect(other)
case other
when All
KeySet.all
when None
KeySet.none
when Some
KeySet.some other.keys
when AllExceptSome
KeySet.all_except_some other.keys
else
raise ArgumentError, 'it needs a valid KeySet'
end
end
|
#invert ⇒ Object
13
14
15
|
# File 'lib/key_set/all.rb', line 13
def invert
KeySet.none
end
|
#remove(other) ⇒ Object
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
|
# File 'lib/key_set/all.rb', line 17
def remove(other)
case other
when All
KeySet.none
when None
KeySet.all
when Some
KeySet.all_except_some other.keys
when AllExceptSome
KeySet.logger.warn "KeySet removing AllButSome, probably a mistake. this: ALL, removing keys: #{other.keys.inspect}"
KeySet.some other.keys
else
raise ArgumentError, 'it needs a valid KeySet'
end
end
|
#represents_all? ⇒ Boolean
9
10
11
|
# File 'lib/key_set/all.rb', line 9
def represents_all?
true
end
|