Class: Cucumber::CucumberExpressions::Transform
- Inherits:
-
Object
- Object
- Cucumber::CucumberExpressions::Transform
- Defined in:
- lib/cucumber/cucumber_expressions/transform.rb
Instance Attribute Summary collapse
-
#capture_group_regexps ⇒ Object
readonly
Returns the value of attribute capture_group_regexps.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
-
#type_name ⇒ Object
readonly
Returns the value of attribute type_name.
Instance Method Summary collapse
-
#initialize(type_name, type, capture_group_regexps, transformer) ⇒ Transform
constructor
Create a new Transform.
- #transform(value) ⇒ Object
Constructor Details
#initialize(type_name, type, capture_group_regexps, transformer) ⇒ Transform
Create a new Transform
15 16 17 18 |
# File 'lib/cucumber/cucumber_expressions/transform.rb', line 15 def initialize(type_name, type, capture_group_regexps, transformer) @type_name, @type, @transformer = type_name, type, transformer @capture_group_regexps = capture_group_regexps.is_a?(String) ? [capture_group_regexps] : capture_group_regexps end |
Instance Attribute Details
#capture_group_regexps ⇒ Object (readonly)
Returns the value of attribute capture_group_regexps.
4 5 6 |
# File 'lib/cucumber/cucumber_expressions/transform.rb', line 4 def capture_group_regexps @capture_group_regexps end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
4 5 6 |
# File 'lib/cucumber/cucumber_expressions/transform.rb', line 4 def type @type end |
#type_name ⇒ Object (readonly)
Returns the value of attribute type_name.
4 5 6 |
# File 'lib/cucumber/cucumber_expressions/transform.rb', line 4 def type_name @type_name end |
Instance Method Details
#transform(value) ⇒ Object
20 21 22 |
# File 'lib/cucumber/cucumber_expressions/transform.rb', line 20 def transform(value) @transformer.call(value) end |