Class: Pattern
- Inherits:
-
Object
- Object
- Pattern
- Defined in:
- lib/patterns/pattern.rb
Instance Attribute Summary collapse
-
#block ⇒ Object
Returns the value of attribute block.
Instance Method Summary collapse
-
#initialize ⇒ Pattern
constructor
A new instance of Pattern.
Constructor Details
#initialize ⇒ Pattern
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
#block ⇒ Object
Returns the value of attribute block.
2 3 4 |
# File 'lib/patterns/pattern.rb', line 2 def block @block end |