Class: RubyExpect::Pattern
- Inherits:
-
Object
- Object
- RubyExpect::Pattern
- Defined in:
- lib/ruby_expect/procedure.rb
Overview
A pattern is a simple container to hold a string/regexp pattern and proc to be called upon match. This is an internal container used by the Procedure class
Instance Attribute Summary collapse
-
#block ⇒ Object
readonly
Returns the value of attribute block.
-
#pattern ⇒ Object
readonly
Returns the value of attribute pattern.
Instance Method Summary collapse
-
#initialize(pattern, &block) ⇒ Pattern
constructor
pattern-
String or Regexp objects to match on.
Constructor Details
#initialize(pattern, &block) ⇒ Pattern
pattern-
String or Regexp objects to match on
block-
The block/proc to be called if a match occurs
35 36 37 38 |
# File 'lib/ruby_expect/procedure.rb', line 35 def initialize pattern, &block @pattern = pattern @block = block end |
Instance Attribute Details
#block ⇒ Object (readonly)
Returns the value of attribute block.
27 28 29 |
# File 'lib/ruby_expect/procedure.rb', line 27 def block @block end |
#pattern ⇒ Object (readonly)
Returns the value of attribute pattern.
27 28 29 |
# File 'lib/ruby_expect/procedure.rb', line 27 def pattern @pattern end |