Module: Case

Defined in:
lib/case.rb

Overview

case.rb - pattern matching for Ruby

Copyright 2008 MenTaLguY <[email protected]>

This library is made available under the same terms as Ruby.

Defined Under Namespace

Modules: Impl Classes: All, Any, Array, Guard, Not, Struct

Constant Summary collapse

Cmp =
Object.new

Class Method Summary collapse

Class Method Details

.[](*args) ⇒ Object

Shorthand for Case::Array.[]



102
103
104
# File 'lib/case.rb', line 102

def self.[](*args)
  Array[*args]
end

.guard(&predicate) ⇒ Object



88
89
90
# File 'lib/case.rb', line 88

def self.guard(&predicate)
  Guard.new &predicate
end