Class: Farce::Abstract::Set Abstract
- Inherits:
-
Collection
- Object
- Collection
- Farce::Abstract::Set
- Includes:
- Internal::MarshalSupport::Initialize
- Defined in:
- lib/farce/abstract/set.rb,
lib/farce/integrations/bson.rb,
lib/farce/integrations/cbor.rb,
lib/farce/integrations/psych.rb,
lib/farce/integrations/msgpack.rb,
lib/farce/integrations/shared/to_json.rb,
lib/farce/integrations/active_support/set.rb,
lib/farce/integrations/active_support/duplicable.rb
Overview
Common interface for concurrent sets backed by Farce maps.
Membership changes are atomic per element. Operations involving several elements are not atomic as a whole. Iteration streams without first copying every element. Structural changes during traversal can invalidate it. Identity comparison and normalization are fixed at construction, so this class does not provide Set#compare_by_identity or Set#reset.
Direct Known Subclasses
SortedSet, WeakSet, Local::Set, Set, Strict::Set, Transaction::Set, Unshared::Set
BSON Integration collapse
-
#as_extended_json(**options) ⇒ Array
Represent current members as Extended JSON, forwarding BSON's format options.
-
#bson_type ⇒ String
Identify this value as a BSON array when embedded in a document or array.
-
#to_bson(buffer = ::BSON::ByteBuffer.new) ⇒ BSON::ByteBuffer
Serialize current members using BSON's array representation.
-
#to_bson_normalized_value ⇒ Array
Return current members with nested values normalized by BSON.
CBOR Integration collapse
-
#to_cbor(*arguments) ⇒ String, ...
Serialize current members as a CBOR array.
ActiveSupport Integration collapse
-
#as_json(options = nil) ⇒ Array
Convert the elements through ActiveSupport's Array JSON conversion.
-
#compact_blank ⇒ Farce::Abstract::Set
Return a same-kind set without blank elements.
-
#compact_blank! ⇒ self
Remove blank elements and return self.
-
#deep_dup ⇒ Farce::Abstract::Set
Deeply copy elements into a set of the same kind with the same settings.
-
#duplicable? ⇒ Boolean
True.
-
#excluding(*elements) ⇒ Farce::Abstract::Set
(also: #without)
Return a same-kind set without the supplied elements.
-
#including(*elements) ⇒ Farce::Abstract::Set
Return a same-kind set with elements added.
-
#to_msgpack(*arguments) ⇒ String, ::MessagePack::Packer
Serialize current members as a MessagePack array.
-
#to_param ⇒ String
Return the elements' ActiveSupport parameter representation.
-
#to_query(key) ⇒ String
Encode the elements as repeated query parameters under a key.
JSON Integration collapse
-
#to_json(*arguments) ⇒ String
Serialize current members as a JSON Array.
Instance Method Summary collapse
-
#<=>(other) ⇒ Integer?
Compare sets by the subset relation.
-
#==(other) ⇒ Boolean
Return whether this set has the same members as another set.
-
#^(other) ⇒ Farce::Abstract::Set
Return a same-kind set containing elements present in exactly one operand.
-
#add(element, mode: UNDEFINED) ⇒ self
(also: #<<)
Add an element and return self.
-
#add?(element, mode: UNDEFINED) ⇒ self?
Add an absent element and return self, or nil if it was already present.
-
#classify {|element| ... } ⇒ Hash{BasicObject => Farce::Abstract::Set}, Enumerator
Group elements by the block result.
-
#clear ⇒ self
Remove all elements and return self.
-
#compare_by_identity? ⇒ Boolean
Return whether membership uses object identity.
-
#delete(element) ⇒ self
Remove an element and return self.
-
#delete?(element) ⇒ self?
Remove an element and return self, or nil if it was absent.
-
#delete_if {|element| ... } ⇒ self, Enumerator
Remove elements accepted by the block.
-
#difference(enumerable) ⇒ Farce::Abstract::Set
(also: #-)
Return a same-kind set without elements from the enumerable.
-
#disjoint?(other) ⇒ Boolean
Return whether this set and another set-like object share no elements.
-
#divide(&block) ⇒ BasicObject
Divide elements into same-kind subsets.
-
#each {|element| ... } ⇒ self, Enumerator
Iterate over the elements currently present without first copying all elements.
-
#eql?(other) ⇒ Boolean
Compare membership using eql?.
-
#flatten ⇒ Farce::Abstract::Set
Return a flattened same-kind set.
-
#hash ⇒ Integer
Return an order-independent hash derived from the members.
-
#include?(element) ⇒ Boolean
(also: #member?, #===)
Return whether an element is present.
-
#initialize(enumerable = nil, normalize: nil, compare_by_identity: false, mode: UNDEFINED, **options) {|element| ... } ⇒ Farce::Abstract::Set
constructor
Construct a set, optionally transforming each initial element before normalization.
-
#intersect?(other) ⇒ Boolean
Return whether this set and another set-like object share an element.
-
#intersection(*enumerables) ⇒ Farce::Abstract::Set
(also: #&)
Return a same-kind set containing elements also present in every enumerable.
-
#keep_if {|element| ... } ⇒ self, Enumerator
Keep elements accepted by the block.
-
#merge(*enumerables) ⇒ self
Add all elements yielded by each enumerable.
-
#proper_subset?(other) ⇒ Boolean
(also: #<)
Return whether this is a proper subset of the other set-like object.
-
#proper_superset?(other) ⇒ Boolean
(also: #>)
Return whether this is a proper superset of the other set-like object.
-
#reject {|element| ... } ⇒ Farce::Abstract::Set, Enumerator
Return a same-kind set without elements accepted by the block.
-
#reject! {|element| ... } ⇒ self, ...
Remove elements accepted by the block, returning nil when unchanged.
-
#select {|element| ... } ⇒ Farce::Abstract::Set, Enumerator
(also: #filter)
Return a same-kind set containing elements accepted by the block.
-
#select! {|element| ... } ⇒ self, ...
(also: #filter!)
Keep elements accepted by the block, returning nil when unchanged.
-
#size ⇒ Integer
Return the number of elements currently present.
-
#subset?(other) ⇒ Boolean
(also: #<=)
Return whether every element is present in the other set-like object.
-
#subtract(enumerable) ⇒ self
Remove every element yielded by enumerable.
-
#superset?(other) ⇒ Boolean
(also: #>=)
Return whether all elements of the other set-like object are present.
-
#to_a ⇒ Array<BasicObject>
Return the elements in an Array.
-
#to_set(klass = ::Set, *arguments, **options) {|element| ... } ⇒ ::Set, Farce::Abstract::Set
Convert to a Ruby Set, or to an explicitly requested set class.
-
#union(*enumerables) ⇒ Farce::Abstract::Set
(also: #|, #+)
Return a same-kind set containing elements from either operand.
-
#weak? ⇒ Boolean
Return whether elements are held weakly.
Methods inherited from Collection
[], #count, #empty?, #join, #length, #to_s
Constructor Details
#initialize(enumerable = nil, normalize: nil, compare_by_identity: false, mode: UNDEFINED, **options) {|element| ... } ⇒ Farce::Abstract::Set
Construct a set, optionally transforming each initial element before normalization.
71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 |
# File 'lib/farce/abstract/set.rb', line 71 def initialize( enumerable = nil, normalize: nil, compare_by_identity: false, mode: UNDEFINED, **, &transform ) unknown = .keys - [:scope] unless unknown.empty? label = unknown.size == 1 ? "keyword" : "keywords" raise ArgumentError, "unknown #{label}: #{unknown.map(&:inspect).join(", ")}" end shareable = !is_a?(Unshareable) validate_boolean!(:compare_by_identity, compare_by_identity) @compare_by_identity = compare_by_identity @normalizer = Internal::KeyNormalizer.build(normalize, shareable:) restoring = Internal::KeyNormalizer.restoration?(normalize) initialize_value_mode(mode) elements = input_elements(enumerable) unless enumerable.nil? elements.map! { transform.call(it) } if transform && elements elements.map! { normalize_element(it) } if elements && @normalizer && !restoring if value_modes? @map = new_map(nil, compare_keys_by_identity: false, **) elements&.each { add_normalized(it) } else entries = elements&.map { [it, true] } @map = new_map(entries, compare_keys_by_identity: compare_by_identity, **) end super() end |
Instance Method Details
#<=>(other) ⇒ Integer?
Compare sets by the subset relation.
469 470 471 472 473 474 |
# File 'lib/farce/abstract/set.rb', line 469 def <=>(other) return unless set_like?(other) return 0 if self == other return -1 if proper_subset?(other) 1 if proper_superset?(other) end |
#==(other) ⇒ Boolean
Return whether this set has the same members as another set.
543 544 545 546 547 548 549 |
# File 'lib/farce/abstract/set.rb', line 543 def ==(other) return true if equal?(other) return false unless other.is_a?(Abstract::Set) && size == other.size return false unless comparison_compatible?(other) index = other.equality_index equality_index.each_key.all? { index.key?(it) } end |
#^(other) ⇒ Farce::Abstract::Set
Return a same-kind set containing elements present in exactly one operand.
394 395 396 397 |
# File 'lib/farce/abstract/set.rb', line 394 def ^(other) other = empty_copy.merge(other) (self - other).merge(other - self) end |
#add(element, mode: UNDEFINED) ⇒ self Also known as: <<
Add an element and return self.
157 158 159 160 161 |
# File 'lib/farce/abstract/set.rb', line 157 def add(element, mode: UNDEFINED) check_frozen! add_normalized(normalize_element(element), mode:) self end |
#add?(element, mode: UNDEFINED) ⇒ self?
Add an absent element and return self, or nil if it was already present.
169 170 171 172 173 |
# File 'lib/farce/abstract/set.rb', line 169 def add?(element, mode: UNDEFINED) # rubocop:disable Naming/PredicateMethod check_frozen! added = add_normalized?(normalize_element(element), mode:) self if added end |
#as_extended_json(**options) ⇒ Array
85 |
# File 'lib/farce/integrations/bson.rb', line 85 def as_extended_json(**) = to_a.as_extended_json(**) |
#as_json(options = nil) ⇒ Array
This methods is only available if ActiveSupport has been loaded.
Convert the elements through ActiveSupport's Array JSON conversion.
46 |
# File 'lib/farce/integrations/active_support/set.rb', line 46 def as_json(...) = to_a.as_json(...) |
#bson_type ⇒ String
This method is only available if BSON has been loaded.
Identify this value as a BSON array when embedded in a document or array.
73 |
# File 'lib/farce/integrations/bson.rb', line 73 def bson_type = ::BSON::Array::BSON_TYPE |
#classify {|element| ... } ⇒ Hash{BasicObject => Farce::Abstract::Set}, Enumerator
Group elements by the block result.
482 483 484 485 486 487 488 489 490 491 |
# File 'lib/farce/abstract/set.rb', line 482 def classify return enum_for(__method__) { size } unless block_given? groups = {} each_stored do |stored_key, stored_value| element = public_stored(stored_key, stored_value) key = yield element (groups[key] ||= empty_copy).add_stored(stored_key, stored_value) end groups end |
#clear ⇒ self
Remove all elements and return self.
234 235 236 237 238 |
# File 'lib/farce/abstract/set.rb', line 234 def clear check_frozen! @map.clear self end |
#compact_blank ⇒ Farce::Abstract::Set
This methods is only available if ActiveSupport has been loaded.
Return a same-kind set without blank elements.
21 |
# File 'lib/farce/integrations/active_support/set.rb', line 21 def compact_blank = reject(&:blank?) |
#compact_blank! ⇒ self
This methods is only available if ActiveSupport has been loaded.
Remove blank elements and return self.
26 |
# File 'lib/farce/integrations/active_support/set.rb', line 26 def compact_blank! = delete_if(&:blank?) |
#compare_by_identity? ⇒ Boolean
Return whether membership uses object identity.
534 |
# File 'lib/farce/abstract/set.rb', line 534 def compare_by_identity? = @compare_by_identity |
#deep_dup ⇒ Farce::Abstract::Set
This methods is only available if ActiveSupport has been loaded.
Deeply copy elements into a set of the same kind with the same settings. Copied elements pass through the set's normal storage rules. Weak results do not keep copied heap elements alive by themselves.
16 |
# File 'lib/farce/integrations/active_support/set.rb', line 16 def deep_dup = map_canonical(&:deep_dup) |
#delete(element) ⇒ self
Remove an element and return self.
178 179 180 181 182 183 184 185 186 187 188 |
# File 'lib/farce/abstract/set.rb', line 178 def delete(element) check_frozen! element = normalize_element(element) if value_modes? key = lookup_key(element) @map.delete(key) unless MISSING_KEY.equal?(key) else @map.delete(element) end self end |
#delete?(element) ⇒ self?
Remove an element and return self, or nil if it was absent.
193 194 195 196 197 198 199 200 201 202 203 |
# File 'lib/farce/abstract/set.rb', line 193 def delete?(element) # rubocop:disable Naming/PredicateMethod check_frozen! element = normalize_element(element) removed = if value_modes? key = lookup_key(element) @map.delete(key) unless MISSING_KEY.equal?(key) else @map.delete(element) end self if removed end |
#delete_if {|element| ... } ⇒ self, Enumerator
Remove elements accepted by the block.
277 278 279 280 281 282 |
# File 'lib/farce/abstract/set.rb', line 277 def delete_if return enum_for(__method__) { size } unless block_given? check_frozen! each_stored { |key, value| @map.delete(key) if yield(public_stored(key, value)) } self end |
#difference(enumerable) ⇒ Farce::Abstract::Set Also known as: -
Return a same-kind set without elements from the enumerable.
377 |
# File 'lib/farce/abstract/set.rb', line 377 def difference(enumerable) = dup.subtract(enumerable) |
#disjoint?(other) ⇒ Boolean
Return whether this set and another set-like object share no elements.
463 |
# File 'lib/farce/abstract/set.rb', line 463 def disjoint?(other) = !intersect?(other) |
#divide({ |element| ... }) {|element| ... } ⇒ Farce::Unshared::Set #divide({ |left, right| ... }) {|left, right| ... } ⇒ Farce::Unshared::Set #divide ⇒ Enumerator
Divide elements into same-kind subsets. The outer result is an Unshared::Set that holds the subsets strongly.
511 512 513 514 515 516 517 518 519 520 521 |
# File 'lib/farce/abstract/set.rb', line 511 def divide(&block) return enum_for(__method__) { size } unless block groups = if block.arity == 2 # Ruby 3.4 also requires TSort here, inside Set#divide. require "tsort" divide_by_relation(&block) else classify(&block).values end Farce::Unshared::Set.new(groups) end |
#duplicable? ⇒ Boolean
This methods is only available if ActiveSupport has been loaded.
Returns true.
43 |
# File 'lib/farce/integrations/active_support/duplicable.rb', line 43 def duplicable? = true |
#each {|element| ... } ⇒ self, Enumerator
Iterate over the elements currently present without first copying all elements.
222 223 224 225 226 |
# File 'lib/farce/abstract/set.rb', line 222 def each return enum_for(__method__) { size } unless block_given? each_element { yield it } self end |
#eql?(other) ⇒ Boolean
Compare membership using eql?.
554 555 556 557 558 559 560 |
# File 'lib/farce/abstract/set.rb', line 554 def eql?(other) return true if equal?(other) return false unless other.is_a?(Abstract::Set) && size == other.size return false unless comparison_compatible?(other) index = other.equality_index equality_index.each_key.all? { index.key?(it) } end |
#excluding(*elements) ⇒ Farce::Abstract::Set Also known as: without
This methods is only available if ActiveSupport has been loaded.
Return a same-kind set without the supplied elements. Array arguments are flattened by one level.
38 |
# File 'lib/farce/integrations/active_support/set.rb', line 38 def excluding(*elements) = difference(elements.flatten(1)) |
#flatten ⇒ Farce::Abstract::Set
Return a flattened same-kind set.
526 527 528 529 530 |
# File 'lib/farce/abstract/set.rb', line 526 def flatten copy = empty_copy flatten_into(self, copy, ::Set.new.compare_by_identity) copy end |
#hash ⇒ Integer
Return an order-independent hash derived from the members.
564 565 566 567 568 569 570 571 572 573 |
# File 'lib/farce/abstract/set.rb', line 564 def hash guard = recursion_guard(:farce_set_hash_guard) return 0 if guard.key?(self) guard[self] = true entered = true set = ::Set.new set.merge(equality_index.keys).hash ensure guard&.delete(self) if entered end |
#include?(element) ⇒ Boolean Also known as: member?, ===
Return whether an element is present.
208 209 210 211 212 213 |
# File 'lib/farce/abstract/set.rb', line 208 def include?(element) element = normalize_element(element) return @map.key?(element) unless value_modes? key = lookup_key(element) !MISSING_KEY.equal?(key) && @map.key?(key) end |
#including(*elements) ⇒ Farce::Abstract::Set
This methods is only available if ActiveSupport has been loaded.
Return a same-kind set with elements added. Array arguments are flattened by one level.
32 |
# File 'lib/farce/integrations/active_support/set.rb', line 32 def including(*elements) = union(elements.flatten(1)) |
#intersect?(other) ⇒ Boolean
Return whether this set and another set-like object share an element.
451 452 453 454 455 456 457 |
# File 'lib/farce/abstract/set.rb', line 451 def intersect?(other) validate_set_like(other) left = equality_index right = relation_index(other) left, right = right, left if right.size < left.size left.each_key.any? { right.key?(it) } end |
#intersection(*enumerables) ⇒ Farce::Abstract::Set Also known as: &
Return a same-kind set containing elements also present in every enumerable.
383 384 385 386 387 388 |
# File 'lib/farce/abstract/set.rb', line 383 def intersection(*enumerables) copy = dup indexes = enumerables.map { membership_index(it) } copy.filter_stored! { |key, _| indexes.all? { it.key?(key) } } copy end |
#keep_if {|element| ... } ⇒ self, Enumerator
Keep elements accepted by the block.
289 290 291 292 293 294 |
# File 'lib/farce/abstract/set.rb', line 289 def keep_if return enum_for(__method__) { size } unless block_given? check_frozen! each_stored { |key, value| @map.delete(key) unless yield(public_stored(key, value)) } self end |
#merge(*enumerables) ⇒ self
Add all elements yielded by each enumerable.
243 244 245 246 247 248 249 250 251 252 253 |
# File 'lib/farce/abstract/set.rb', line 243 def merge(*enumerables) check_frozen! enumerables.each do |enumerable| if canonical_compatible?(enumerable) enumerable.each_stored { |key, value| add_stored(key, value) } else each_input(enumerable) { add(it) } end end self end |
#proper_subset?(other) ⇒ Boolean Also known as: <
Return whether this is a proper subset of the other set-like object.
415 416 417 418 419 420 |
# File 'lib/farce/abstract/set.rb', line 415 def proper_subset?(other) validate_set_like(other) left = equality_index right = relation_index(other) left.size < right.size && left.each_key.all? { right.key?(it) } end |
#proper_superset?(other) ⇒ Boolean Also known as: >
Return whether this is a proper superset of the other set-like object.
439 440 441 442 443 444 |
# File 'lib/farce/abstract/set.rb', line 439 def proper_superset?(other) validate_set_like(other) left = equality_index right = relation_index(other) left.size > right.size && right.each_key.all? { left.key?(it) } end |
#reject {|element| ... } ⇒ Farce::Abstract::Set, Enumerator
Return a same-kind set without elements accepted by the block.
312 313 314 315 |
# File 'lib/farce/abstract/set.rb', line 312 def reject return enum_for(__method__) { size } unless block_given? dup.filter_backend! { !yield(it) } end |
#reject! {|element| ... } ⇒ self, ...
Remove elements accepted by the block, returning nil when unchanged.
322 323 324 325 326 327 328 329 330 |
# File 'lib/farce/abstract/set.rb', line 322 def reject! return enum_for(__method__) { size } unless block_given? check_frozen! changed = false each_stored do |key, value| changed = true if yield(public_stored(key, value)) && @map.delete(key) end self if changed end |
#select {|element| ... } ⇒ Farce::Abstract::Set, Enumerator Also known as: filter
Return a same-kind set containing elements accepted by the block.
301 302 303 304 |
# File 'lib/farce/abstract/set.rb', line 301 def select return enum_for(__method__) { size } unless block_given? dup.filter_backend! { yield it } end |
#select! {|element| ... } ⇒ self, ... Also known as: filter!
Keep elements accepted by the block, returning nil when unchanged.
337 338 339 340 341 342 343 344 345 |
# File 'lib/farce/abstract/set.rb', line 337 def select! return enum_for(__method__) { size } unless block_given? check_frozen! changed = false each_stored do |key, value| changed = true if !yield(public_stored(key, value)) && @map.delete(key) end self if changed end |
#size ⇒ Integer
Return the number of elements currently present.
230 |
# File 'lib/farce/abstract/set.rb', line 230 def size = @map.size |
#subset?(other) ⇒ Boolean Also known as: <=
Return whether every element is present in the other set-like object.
403 404 405 406 407 408 |
# File 'lib/farce/abstract/set.rb', line 403 def subset?(other) validate_set_like(other) left = equality_index right = relation_index(other) left.size <= right.size && left.each_key.all? { right.key?(it) } end |
#subtract(enumerable) ⇒ self
Remove every element yielded by enumerable.
258 259 260 261 262 263 264 265 266 267 268 269 270 |
# File 'lib/farce/abstract/set.rb', line 258 def subtract(enumerable) check_frozen! if canonical_compatible?(enumerable) retained = membership_index(enumerable) @map.delete_if { |element, _| retained.key?(element) } else each_input(enumerable) do |element| key = lookup_key(normalize_element(element)) @map.delete(key) unless MISSING_KEY.equal?(key) end end self end |
#superset?(other) ⇒ Boolean Also known as: >=
Return whether all elements of the other set-like object are present.
427 428 429 430 431 432 |
# File 'lib/farce/abstract/set.rb', line 427 def superset?(other) validate_set_like(other) left = equality_index right = relation_index(other) left.size >= right.size && right.each_key.all? { left.key?(it) } end |
#to_a ⇒ Array<BasicObject>
Return the elements in an Array.
350 |
# File 'lib/farce/abstract/set.rb', line 350 def to_a = each.to_a |
#to_bson(buffer = ::BSON::ByteBuffer.new) ⇒ BSON::ByteBuffer
This method is only available if BSON has been loaded.
Serialize current members using BSON's array representation. Nested value wrappers are read before encoding their BSON types and payloads.
68 |
# File 'lib/farce/integrations/bson.rb', line 68 def to_bson(buffer = ::BSON::ByteBuffer.new) = to_bson_normalized_value.to_bson(buffer) |
#to_bson_normalized_value ⇒ Array
This method is only available if BSON has been loaded.
Return current members with nested values normalized by BSON.
78 |
# File 'lib/farce/integrations/bson.rb', line 78 def to_bson_normalized_value = to_a.to_bson_normalized_value |
#to_cbor(*arguments) ⇒ String, ...
39 |
# File 'lib/farce/integrations/cbor.rb', line 39 def to_cbor(...) = to_a.to_cbor(...) |
#to_json(*arguments) ⇒ String
This method is only available if a supported JSON library has been loaded.
Serialize current members as a JSON Array.
31 |
# File 'lib/farce/integrations/shared/to_json.rb', line 31 def to_json(...) = to_a.to_json(...) |
#to_msgpack(*arguments) ⇒ String, ::MessagePack::Packer
This method is only available if MessagePack has been loaded.
Serialize current members as a MessagePack array.
34 |
# File 'lib/farce/integrations/msgpack.rb', line 34 def to_msgpack(...) = to_a.to_msgpack(...) |
#to_param ⇒ String
This methods is only available if ActiveSupport has been loaded.
Return the elements' ActiveSupport parameter representation.
51 |
# File 'lib/farce/integrations/active_support/set.rb', line 51 def to_param = to_a.to_param |
#to_query(key) ⇒ String
This methods is only available if ActiveSupport has been loaded.
Encode the elements as repeated query parameters under a key.
57 |
# File 'lib/farce/integrations/active_support/set.rb', line 57 def to_query(key) = to_a.to_query(key) |
#to_set(klass = ::Set, *arguments, **options) {|element| ... } ⇒ ::Set, Farce::Abstract::Set
Convert to a Ruby Set, or to an explicitly requested set class.
362 363 364 365 |
# File 'lib/farce/abstract/set.rb', line 362 def to_set(klass = ::Set, *arguments, **, &) return self if klass == self.class && arguments.empty? && .empty? && !block_given? klass.new(self, *arguments, **, &) end |
#union(*enumerables) ⇒ Farce::Abstract::Set Also known as: |, +
Return a same-kind set containing elements from either operand.
370 |
# File 'lib/farce/abstract/set.rb', line 370 def union(*enumerables) = dup.merge(*enumerables) |
#weak? ⇒ Boolean
Return whether elements are held weakly.
538 |
# File 'lib/farce/abstract/set.rb', line 538 def weak? = @map.weak_keys? |