Class: Set

Inherits:
Object show all
Defined in:
lib/data/functions/set.rb

Instance Method Summary collapse

Instance Method Details

#to_procProc

Convert Set into a Proc that takes a value and returns true if the value is an element of the set or false otherwise.

Returns:

  • (Proc)


7
8
9
10
11
# File 'lib/data/functions/set.rb', line 7

def to_proc
  lambda do |v, *_|
    self.include?(v)
  end
end