Class: Set

Inherits:
Object show all
Includes:
Jinx::Collection
Defined in:
lib/jinx/helpers/set.rb,
lib/jinx/helpers/collections.rb,
lib/jinx/helpers/pretty_print.rb

Instance Method Summary collapse

Methods included from Jinx::Collection

#compact, #compact_map, #detect_value, #detect_with_value, #difference, #empty?, #filter, #first, #flatten, #hashify, #intersect, #join, #last, #partial_sort, #partial_sort!, #partial_sort_by, #size, #to_compact_hash, #to_compact_hash_with_index, #to_series, #transform, #union

Instance Method Details

#pretty_print(q) ⇒ Object

Formats this set using Enumerable#pretty_print.



206
207
208
209
210
# File 'lib/jinx/helpers/pretty_print.rb', line 206

def pretty_print(q)
  # mark this object as visited; this fragment is inferred from pp.rb and is necessary to detect a cycle
  Thread.current[:__inspect_key__] << __id__
  to_a.pretty_print(q)
end

#pretty_print_cycle(q) ⇒ Object

The pp.rb default pretty printing method for general objects that are detected as part of a cycle.



213
214
215
# File 'lib/jinx/helpers/pretty_print.rb', line 213

def pretty_print_cycle(q)
  to_a.pretty_print_cycle(q)
end