Class: RFunk::Match::Pattern

Inherits:
Object
  • Object
show all
Defined in:
lib/rfunk/match/pattern.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializePattern

Returns a new instance of Pattern.


6
7
8
# File 'lib/rfunk/match/pattern.rb', line 6

def initialize
  @cases = []
end

Instance Attribute Details

#casesObject (readonly)

Returns the value of attribute cases


4
5
6
# File 'lib/rfunk/match/pattern.rb', line 4

def cases
  @cases
end

Instance Method Details

#with(type, func) ⇒ Object


10
11
12
13
# File 'lib/rfunk/match/pattern.rb', line 10

def with(type, func)
  cases << [type, func]
  RFunk.none
end