Module: PatternMatching::DSL_INSIDE

Included in:
PatternMatching, PatternFragments
Defined in:
lib/patternmatching/pattern.rb

Overview

Domain Specific Language style methods for inside block

Instance Method Summary collapse

Instance Method Details

#as(&block) ⇒ Object

A pattern matches description inside block

Usage

seems as pattern… do … end



8
9
10
# File 'lib/patternmatching/pattern.rb', line 8

def as(&block)
  block
end

#somethingObject

A pattern matches anything

Usage

seems something do … end



22
23
24
# File 'lib/patternmatching/pattern.rb', line 22

def something
  proc {_}
end

#with(&block) ⇒ Object

A pattern restriction, must boolean

Usage

seems as PATTERN, with CONDITION do … end



15
16
17
# File 'lib/patternmatching/pattern.rb', line 15

def with(&block)
  block
end