Sha256: ce24413eafa29a20786e7621b6db5e8c2e33613888cb38fc8aaf10c16923e7f6

Contents?: true

Size: 424 Bytes

Versions: 1

Compression:

Stored size: 424 Bytes

Contents

# This class inherits from +Proc+ and overrides its +===+ method
# letting you use proc instances in +case+ statements (see the {file:README.rdoc README})
class ProcForCaseEquality < Proc
  # It calls +Proc#call+ in order to get used together in
  # the +case+ statement.
  #
  # @param *params Any object.
  # @return the proc calling using its argument(s) as argument(s)
  def ===(*params)
    self.call *params
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
proc_for_case_equality-0.1 lib/proc_for_case_equality.rb