Class: RubyExpect::Pattern

Inherits:
Object
  • Object
show all
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

Instance Method Summary collapse

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

#blockObject (readonly)

Returns the value of attribute block


27
28
29
# File 'lib/ruby_expect/procedure.rb', line 27

def block
  @block
end

#patternObject (readonly)

Returns the value of attribute pattern


27
28
29
# File 'lib/ruby_expect/procedure.rb', line 27

def pattern
  @pattern
end