Class: Cucumber::Glue::RegistryWrapper

Inherits:
Object
  • Object
show all
Defined in:
lib/cucumber/glue/registry_wrapper.rb

Overview

This class wraps some internals methods to expose them to external plugins.

Instance Method Summary collapse

Constructor Details

#initialize(registry) ⇒ RegistryWrapper

Returns a new instance of RegistryWrapper.



8
9
10
# File 'lib/cucumber/glue/registry_wrapper.rb', line 8

def initialize(registry)
  @registry = registry
end

Instance Method Details

#create_expression(string_or_regexp) ⇒ Object

Creates a new CucumberExpression from the given string_or_regexp.

If string_or_regexp is a string, it will return a new CucumberExpression::CucumberExpression

If string_or_regexp is a regexp, it will return a new CucumberExpressions::RegularExpression

An ArgumentError is raised if string_or_regexp is not a string or a regexp



20
21
22
# File 'lib/cucumber/glue/registry_wrapper.rb', line 20

def create_expression(string_or_regexp)
  @registry.create_expression(string_or_regexp)
end

#current_worldObject

Return the current execution environment - AKA an isntance of World



26
27
28
# File 'lib/cucumber/glue/registry_wrapper.rb', line 26

def current_world
  @registry.current_world
end