Class: Pattern

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializePattern

Returns a new instance of Pattern.



4
5
6
7
8
# File 'lib/patterns/pattern.rb', line 4

def initialize
  @block = lambda do |m|
    m.match :price , /(\d+)/
  end
end

Instance Attribute Details

#blockObject

Returns the value of attribute block.



2
3
4
# File 'lib/patterns/pattern.rb', line 2

def block
  @block
end